Re: Newbie First Question: events.xml

Stefan Armbruster <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Jim,

see comments below.
Am Mit, 2003-05-21 um 20.56 schrieb JIM & ALISON DOW:
> Hi,
>  
> Newbie here with first confusion over purpose of "events.xml".  I'm
> having trouble finding in the examples or mail archives a
> concise explanation of:
>  
>      1. Purpose of events.xml 
events.xml is the source for a class generator that produces the event
classes. The generator is called by a ant target ("build_events"). It
refers to org.enhydra.barracuda.taskdefs.EventBuilder that does the
dirty work.

>      1. How it ties in to code that I write (I have a working sample
>         not using events.xml). 
When you define the event listeners (normaly by using
DefaultEventGateway.specifyLocalEventInterests) you just reference the
event classes from events.xml and associate them with the event
handlers.

>      1. Why would I want to use it? 
You do not have to write the event classes yourself, just use ant task
(check out the Barracuda's build.xml to see how it works). Since all
events are defined in one place, you can easily e.g. insert a common
parent event without modifying multiple files.

>      2. Why might I not want to use events.xml?
If your events should have more features than the generated code. IMHO
it's bad design to put functionality in the event classes itself... so I
don't know any good reason for not using the EventBuilder.

Regards,
Stefan

> Thank you for your help on this,
>  
> Jim Dow
>  
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.