--
You received this message because you are subscribed to the Google Groups "Service Oriented Design With Ruby" group.
To post to this group, send email to service-oriented...@googlegroups.com.
To unsubscribe from this group, send email to service-oriented-desig...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/service-oriented-design-with-ruby?hl=en.
Also, unless things have changed, ActiveResource uses a crappy single
threaded Net::HTTP connection. In a real world scenario you'd want to
use either asynchronous calls or a connection pool operating in
multiple threads to send simultaneous requests. That just isn't
possible if you're using ActiveResource.
I guess I just wouldn't ever use ActiveResource on a project so I
thought it would be wrong to provide coverage for a tool I just
wouldn't use. Maybe I'm being too harsh?
Paul
Having said that, I don't think there's a big gain to turning just
basic CRUD stuff into services. The best things to turn into services
are things that have complex behavior behind them. Take something like
a recommendations system (like Amazon's suggested or Netflix or
whatever). The logic to create something like that goes way beyond
simple CRUD. You have to train models, optimize for real-time lookups,
experiment with new models, etc. Or I could take another example from
a feed reader. The logic to get new feeds, update feeds, and parse can
be quite complex. It's good to hide all that logic behind a service in
a code base all its own.
The best services are ones that encapsulate an iceberg of code and
business logic. The API may be small, but it's only the tip of the
berg. The real work goes on behind the scenes. Of course, sometimes
it's good to have services for things that are simple CRUD. The
example there would be a user management and authentication service
that multiple applications can use. I'm pretty sure 37signals switch
over to something like this last year for all their apps.
Hope that helps,
Paul
Paul