RE: How we are using Barracuda - [was - Additional ch ange to DefaultViewHandler proposal...]

"James Carnegie" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <004601c2e4b9$7799dc50$139dbdc0@somnus>
An example of polymorphic events:

Suppose that you would like all your web pages to be secured by a login
and password. All you would have to do, is have all Control Events in
the system extend a common authorisation event. So when any Control
event is fired, the authorisation event is first fired and must be
handled before Barracuda will even dispatch the original event. So the
handler for the authorisation event can either authorise the user and
set the event handled, allowing the original event to be handled, or it
could redirect the user to a login page.

In my experience however, one of the most useful aspects of the
Polymorphic event mechanism, is that it allows you to completely modify
or add to the behaviour of a whole application by the inserting an event
in the control event hierarchy - one of the main reasons for using the
Barracuda Event model in our Prestel screen scraping malarkey.

Hope this clears things up a bit,

James.

Chris Webb wrote:
>It's been a while since I looked at the event model but this was the 
>part of Barracuda I struggled with most, probably mostly an issue with 
>my brain though ;) I'd be interested to hear some benefits and 
>use cases 
>of ploymorphic events.
>
>Cheers,
>Chris
>
>Kirk Daries wrote:
>
>>>>>>P.S. The concept of Exceptional and Polymorphic Events is 
>so useful 
>> in our system that it also deserves a mention. :)
>>  
>> Agreed..... I just LOVE the event model .. ;)
>>  
>> Regards
>> KD
>>
>>     -----Original Message-----
>>     *From:* James Carnegie [mailto:[email protected]]
>>     *Sent:* 07 March 2003 11:58
>>     *To:* [email protected]
>>     *Subject:* [Barracuda] How we are using Barracuda - [was -
>>     Additional change to DefaultViewHandler proposal...]
>>
>>     Hi Christian et al,
>>      
>>     A few words on how we are using Barracuda outside the 
>web paradigm
>>     then...
>>      
>>     We are working on our new Prestel screen scraping 
>technology (urgh
>>     I know) which exposes an xml interface (often consumed by our
>>     Barracuda web apps :) ). Barracuda provides a robust event
>>     framework that fits brilliantly into the request/response nature
>>     of our design. When the system receives an xml request, a
>>     Barracuda event is fired. The handler for that event fires a
>>     response event that outputs a character onto the Prestel screen.
>>     When something happens on the Prestel screen as a response to a
>>     user request, another request event is fired. The 
>handler for this
>>     event will fire a response event whose handler will generate an
>>     xml response to the user. Hence, there are 2 request/response
>>     cycles in our system for each user request/response cycle.
>>      
>>     So we are not using much of Barracuda, but the parts we are using
>>     are serving us well.
>>      
>>     James.
>>      
>>     P.S. The concept of Exceptional and Polymorphic Events is so
>>     useful in our system that it also deserves a mention. :)

<snip>
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.