Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# mrt 9/16/2008 12:28 PM
Sorry if this has been covered but I couldn't find it.

I'm trying to understand the best way to use the SessionManager in modules I'm building. It's available in the module class but not in the domain classes. I'd like the domain classes to have business logic methods. Obviously I don't want to pass the session manager into the domain objects. It would also be good if I could use the domain objects without a module, but I'm not sure how to create my own session manager.

Could someone explain how the architecture is supposed to work? Most modules appear to have all their business logic in the module class.
# martijnb 9/16/2008 2:46 PM
I never let my domain objects know about persistence. The usual scenario is that the UI calls a Service that manages transactions and delegates persistence to data access objects. In simple cases, I put everything in the module controllers (...Module classes).
# mrt 9/16/2008 3:18 PM
ok, that does make more sense. I suppose that's more like the MVC method, at least the M and C parts. I'm currently putting that transaction logic in the module so I'll keep doing that for now.