Justin Makeig wrote:
Am I missing something?
No, you're not missing anything. I think it just depends on your
goals/setup/platform/etc.
In my setup, it looks like this (from top down):
Restlets (routers, filters, authenticators, etc.)
My Custom Finder
Anonymous Inner Class Resource (created per request)
Spring Bean "Service" Layer (business rules, transaction mgt, etc.)
Spring Bean DAOs
Persistence
In my scenario, I don't want my "service" layer objects to be created
per request. That's because these are comparatively slower to create
than, for example, the thin adapter/connector layer above (the inner
classes).
As with anything, it all depends on your setup. I like having my spring
managed beans as singletons as I tend to think of them as such. It just
feels right to me. But you might have something different going on and
having spring create your lower level classes per request might
(probably will) work OK as well.
I'm not overly concerned about optimization really. I'm just looking at
it more from my rose colored glasses I guess.
Hope that helps,
Adam