[REBOL] Re: Laccio Framework
From: ale870::gmail::com at: 22-Aug-2007 15:53
Like an Enterprise Service Bus (SOA like)?
Here a simple example:
you use a component called "calculator" that is a real calculator (with the
operations for sum, subtraction, multiply, divide).
You want to insert the calculator in your application, but you want to get a
message every time the user press "total" button (button "="). So you create
a function in your program called "saveResults" (which save the results in a
text file). Then you insert the following code in your application:
==============================================
; CREATE AND INIT CALCULATOR COMPONENT
myCalculator: make TCalculator[ ]
myCalculator/init
; REGISTER YOUR FUNCTION TO GET THE MESSAGE "msgAfterTotal"
myCalculator/controller/addListener "msgAfterTotal" 'saveResults
==============================================
That's all. Now, one month later, you need to display the results in a
different form, like a stream, with all the results calculated. You create
another function (so you don't touch original function, that works very well
;-) ) called "showResultsToVideo".
You simply add in your program the new function (obviously, you need to
create it!), then insert the following line (after the previous lines):
==============================================
myCalculator/controller/addListener "msgAfterTotal" 'showResultsToVideo
==============================================
Now, when the user press the "=" key, both of functions will be called, in
the same order of the registration.
On 8/22/07, John Blake <jblake-arsenaldigital.com> wrote:
>
> "
> Example: if you create a button, you can associate only a function to
> its click; instead, if you use Laccio, you can associate as many
> "listeners" as you want to a single event (message)."
>
> Like an Enterprise Service Bus (SOA like)?
>
> John
>
> -----Original Message-----
> From: rebol-bounce-rebol.com [mailto:rebol-bounce-rebol.com] On Behalf
> Of Alessandro Manotti
> Sent: Wednesday, August 22, 2007 3:25 AM
> To: rebolist-rebol.com
> Subject: [REBOL] Re: Laccio Framework
>
> Hi Alessandro:
> > I downloaded your first sample and will take a look at it.
> > I'm sure that I will have some questions to ask, and I will
> > post them to this ML.
> >
> > BTW: I'm referring to a very proprietory organization - so I'm
> > not at liberty to say *who* and must leave out some details, but
> > here's their scenario:
> >
> > Many - perhaps hundreds - of small rebol scripts running and
> > being managed project-wise via TCP/IP. Including message-passing.
> >
> > Different from my way of doing things, but very rebol-ish in fact, I
> > think.
> > I manage large projects by "loading" or "importing" modules via
> > 'do, whereas they are using TCP/IP. I don't know if they use
> > rugby or if rugby would be helpful.
> >
> > tim
>
> Hello,
>
> there is no restriction using Laccio Framework and tcp/ip or other
> protocols.
> Infact, Laccio is a single ".R" file, that you can directly download and
> import using something like:
>
> >> do read http://myserver/laccio.r
>
> Furthermore, the components could be created using a single ".R" file or
> more files, that you can download and use in your environment.
>
> About message passing, it is not used to exchange information, since
> Rebol
> already supports several protocols and method to efficently solve the
> scope.
> WHen I talk about "message", I'm talking about events. I named them
> messages, since a message is a signal that a method can send, and if
> your
> procedure is registered to receive such event, it will grab it. And
> consider
> that, usually when you use the typical event dispatcher, you can
> associate
> only a method to a single event. Example: if you create a button, you
> can
> associate only a function to its click; instead, if you use Laccio, you
> can
> associate as many "listeners" as you want to a single event (message).
>
> I downloaded your first sample and will take a look at it.
> > I'm sure that I will have some questions to ask, and I will
> > post them to this ML.
> >
>
> You are welcome! Please don't hesitate to make me any question!
>
> On 8/22/07, Tim Johnson <tim-johnsons-web.com> wrote:
> >
> >
> > On Tuesday 21 August 2007, Alessandro Manotti wrote:
> > > Hello,
> > >
> > > I wish to highlight a new project I started, and currently in
> beta-test.
> > > It is called Laccio Framework.
> > < .. snip .. >
> > Hi Alessandro:
> > I downloaded your first sample and will take a look at it.
> > I'm sure that I will have some questions to ask, and I will
> > post them to this ML.
> >
> > BTW: I'm referring to a very proprietory organization - so I'm
> > not at liberty to say *who* and must leave out some details, but
> > here's their scenario:
> >
> > Many - perhaps hundreds - of small rebol scripts running and
> > being managed project-wise via TCP/IP. Including message-passing.
> >
> > Different from my way of doing things, but very rebol-ish in fact, I
> > think.
> > I manage large projects by "loading" or "importing" modules via
> > 'do, whereas they are using TCP/IP. I don't know if they use
> > rugby or if rugby would be helpful.
> >
> > tim
> > --
> > To unsubscribe from the list, just send an email to
> > lists at rebol.com with unsubscribe as the subject.
> >
> >
>
> --
>
> --Alessandro
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
> --
> To unsubscribe from the list, just send an email to
> lists at rebol.com with unsubscribe as the subject.
>
--
--Alessandro