On 28 Oct (10:33), Miguel Henley wrote:

> So, do you think that for each persitence class it's a good design decision to 
> create a Manager class ?  The Manager class first check the business rules and if 
> it's Ok calls the save / update / delete methods of the session. Is it right ?

No, this is not a good design decision. Your domain model classes should
implement the business rules and functions. Some of them might be
persistent, but thats what you have Hibernate for. Sometimes you might
use a "Manager" type class in your domain model, but most of the time
the objects _themselves_ interact by calling business methods on each
other and/or passing themselves as arguments.

Read up on "Strategy Pattern" and other techniques how to implement
this. A good source is Martin Fowler's Patterns of Enterprise
Architecture, but it's not "only" about domain model/transaction
scripts/business logic design issues.

-- 
Christian Bauer
[EMAIL PROTECTED]


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to