Re: Newbie First Question: events.xml

"JIM & ALISON DOW" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Kirk,

I get it.  My Barracuda light is shining a little brighter now.  I got the ant task to generate the events for me based on an events.xml file.

I really appreciate your help.

Thanks!

Jim
  ----- Original Message ----- 
  From: Kirk Daries 
  To: [email protected] 
  Sent: Thursday, May 22, 2003 2:44 AM
  Subject: RE: [Barracuda] Newbie First Question: events.xml


  Hi Jim,

  I'm not a Barracuda Guru... so I hope I don't confuse you.

  The one thing I love about Barracuda, is that your're not confined to doing things in one particular way.
  That said. 
  It's also the reason most 'newbies' have trouble getting started and understanding the code/architecture.

  Since you say you have a working example... I take it I don't need to rehash everything ;).
  Here's a run down of the events xml file.

  If you've read up on the event architecture, you'll know that request events are 'polymorphic' in nature.
  Basically this means that there's is a possible parent/child relationship within the events you define.
  When the child/target event is 'fired' the listeners for the event will 'fire' from the parent events-listeners
  down to the child/target event-listeners. 

  This is how Barracuda builds it's event Hierarchy.

  Now, if we dive into the code. 
  To accomplish the above. All you have to do is have a event (a class) which extends another event (another class).
  Now imagine you've created 12 events for your first application. 
  If you need to restructure the events for what ever the reason.... you have to change manually change events classes.

  (1)What the events.xml file does... is that it allows you to specify which classes extend what. 
  There is a Barracuda ant task-definition that parses the file and creates the layout for you.
  This means when your event structure changes... you don't have to manually change those events.

  (2)No more hand coding the events. They're generated for you.

  (3)To externally maintain the event structure. 
  Changes to the structure just require a change to the xml file and no physical code changes.

  (4)The downside is that events are generated for you. 
  There is always the possibility that you'd want to add some code to you events.
  But 98% of the time.... you won't need to. 

  HTH
  Regards
  KD

    -----Original Message-----
    From: JIM & ALISON DOW [mailto:[email protected]]
    Sent: 21 May 2003 08:56
    To: [email protected]
    Subject: [Barracuda] Newbie First Question: events.xml


    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 
      2.. How it ties in to code that I write (I have a working sample not using events.xml). 
      3.. Why would I want to use it? 
      4.. Why might I not want to use events.xml?
    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.