|
Re: Is there anyway to lock and entire event?
|
K.M. Ensign
|
Nov 15, 2006 20:54 PST
|
so you are describing a situation where many clients have references to an
object and you need to delete the whole thing or parts of it? Is the object
really an aggregate root?
http://codebetter.com/blogs/scott.bellware/archive/2006/01/03/136105.aspx
sounds like a this is more of a modeling problem and less of a framework
problem, especially if you do not have a service layer. business logic in
your listeners is a big indicator that you need to refactor them and push
that logic into the model. it's not easy, but it is rewarding.
food for thought:
http://wiki.java.net/bin/view/People/SmellsToRefactorings
best,
Keith
On 11/15/06, Mark Mandel <mark.m-@gmail.com> wrote:
| |
I'm just seeing events where there are mutiple calls to different
listeners, so being able to lock the whole event would actually make
sense.
I'm guessing this is where a service layer would be highly useful.
Mark
On 11/16/06, Peter J. Farrell <pj-@maestropublishing.com> wrote:
| | Mark Mandel said the following on 11/15/2006 5:26 PM:
| | This may be more of an enhancement request, but -
Basically there are some events in out system which I would like to be
able to lock down to being only single threads. (i,e. synchronized)
The classic example being deletion of certain items from the database
actually has to do a lot of processing to get all the child items,
delete them, etc etc.
If two threads are run on the same object to be deleted at the same
time, or mid process, it can cause all sorts of weirdness to occur.
Is there anyway I can do something like:
<event-handler event="deleteThisThing" synchronised="true">
..
</event-handler>
Cheers,
Mark
|
Mark,
This is best probably best put in your model layer via a cflock. While
this ideas would be sorta ok when all request go through Mach-II, the
addition of Flex or non-Mach-II requests would cause the synchronized to
be ignored.
Best,
.Peter
|
--
E: mark.m-@gmail.com
W: www.compoundtheory.com
|
|
|
 |
|