The Main Component

The Main Component defines a simple Component, which has the standard ports*[1] added. It is always used as base-component.
In this way, “main components”[2] have the invoke event, known by the Command Pattern.

Castle programmers can easily implement such a “main component”, by implementing that event-handler, and run it by calling invoke() on an elements. Using the the @impliciet rewriter makes it even more simple, as can be seen in the demo below.

@impliciet(Main)                   ///GAM: This `rewriter` auto-generates the interface -- based on Main
implement Demo {

invoke() on self.std {
   // ....
}

Caution

At the moment there is no design for bidir-ports. The idea is that a ‘bidir (event) port’ is both an input and an output port combined.

So, the Castle programmer can (or must?) write an event-handler for every event in the protocol, and sent all event out over that port.


Footnotes

Comments

comments powered by Disqus