ActiveObject Observer (Channel Events)

ActiveObject Observer (Channel Events)

Old forum URL: forums.lhotka.net/forums/t/1537.aspx


mr_lasseter posted on Thursday, October 19, 2006

I have a ReadOnlyList (Regions) of ReadOnlyItems (RegionInfo).  I also have an EditableRoot (Region).  These two objects should know nothing about each other so I would list to use the ChannelEvent to Publish & Subscribe so the list can add a readonly object when a region is Added/Updated/Deleted.  I thought about adding the publish events in the DataPortal, which would work since everything is running locally, but if I ever did move to N physical tiers it would not work since the event would be raised on the middle machine on not on the clients machine.

Where is the best place to Publish the event?

 

Thanks in advance,

Mike

xal replied on Thursday, October 19, 2006

Active Objects solves this automatically by "buffering" all the events that are raised in a remote dp and refiring them when the object gets back from the dp.

Andrés

mr_lasseter replied on Thursday, October 19, 2006

What if I just want to use the Observer.dll instead of the whole active object project? 

I guess I could keep track of what data portal event was called and publish this information in the Overriden Saved method?  Any thoughts or a better approach?

xal replied on Thursday, October 19, 2006

Well, then you'd have to consider an approach similar to the one in ao.
Instead of calling observer directly, you need a method in your base class like Publish(). You need to detect whether you're on a remote dp or not and if you are, then store the event info somewhere and then refire the events when the object is deserialized.

Andrés

Copyright (c) Marimer LLC