Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Event driven models Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Event driven models" Watch "Event driven models" New topic
Author

Event driven models

Henry Canterburry
Greenhorn

Joined: Sep 11, 2006
Posts: 4
So it has been a while since I really wrote a domain model from scratch. I need to write a domain model that keeps track of models. So, a meta model for models...basically think the class/properties/relationship hierarchies you see in IDEs.

Naturally, there will be plenty of referential integrity to keep track of inside the model when things change, move, get renamed etc. So, an event-driven model sounds logical, where other parts of the model listen for events from other model components and update their state when changes elsewhere occur.

Ok, so it has been a while since I wrote change listeners and event mechanisms...has anything changed in the last 5 years or so? Any updated design patterns? New approaches? I did some searches and it seems all new writing on this topic stops around 2002 or so. So what does this mean...no one writes event driven models anymore?

Are there any handly open source frameworks out there that makes this a snap...oh, and I don't think Spring will be an option in this case.
John Kelty
Ranch Hand

Joined: Aug 08, 2006
Posts: 33
Event driven models still make as much sense as ever to use. They are still in use all over the place and new designs should never hesitate to use them whenever they make sense.

As far as "new" design patterns, if you couldn't find any new material on event driven design patterns, I would say that the "classic" ones you were using a few years ago are still valid.

--John
Henry Canterburry
Greenhorn

Joined: Sep 11, 2006
Posts: 4
Thanks so much John,

One thing I did look into was using aspects to intercept changes and fire the events. That might be a somewhat newer appoach? Anyone used aspects for this?

In fact, i would be interested to hear what experiences people have had with aspects overall.

Thanks
John Kelty
Ranch Hand

Joined: Aug 08, 2006
Posts: 33
Your welcome.

I would still think you should use traditional un-aspected code where possible. I don't think aspects bring that much to the table that a nice set of Event classes and Interfaces can't accomplish in a more OO and well-understood manner, and without needing AspectJ or some other new tool. I don't think events are truly "cross cutting" enough to require Aspects.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Event driven models