-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: detach life cycle logic from business object?
PostPosted: Wed Jan 28, 2004 10:06 pm 
Newbie

Joined: Wed Jan 28, 2004 9:36 pm
Posts: 2
It is good that now the business objects 'almost' have no dependencies on the persistent framework, either by inheritance from a heavy persistent base class, or by invoking framework API within the business object.

however, the Lifecycle interface still causes such dependency. as a result we can not say use the object in a client application. some heavy logics triggered by life cycle event has to be put into the business object which brings even more dependencies. and it is inconvinient to customize different actions responding life cycle event for different deployment environment (out product needs different action for different customer)

unfortuntely JDO also has the same approach. your divine POJO is tainted with sign of ugly beast in the background.

I fully understand the reason for this approach, but I'd really like to have an alternative, event-listener based mechanism, so that the logics in reponse to persistent events are not coupled inside the business object. something like HB.register(Cat.class, aDeleteListener). this is a tiny bit more coding work, but the benefit will be great.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2004 10:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
That is why we created the Interceptor interface.


By the way, in HIbernate 2.2 we will introduce an extensive event framework (work on this is already underway).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 28, 2004 10:22 pm 
Newbie

Joined: Wed Jan 28, 2004 9:36 pm
Posts: 2
thanks! I did a search on this forum and found that it's an old problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.