[Clam-devel] TypedControls: asking for advice and opinions

Hernán Ordiales h at ordia.com.ar
Fri Jun 27 20:29:51 PDT 2008


On Fri, Jun 27, 2008 at 6:50 AM, Pau Arumí Albó <parumi at iua.upf.edu> wrote:
[snip]
> Yep! this is a conceptual problem.
> With typed controls (or ports) the GetInControl(...) interface should
> not be used by client classes.
> One should only use typed controls in three ways
>      * From within the concrete class: _myOutControl.Send(myObject);
>      * Connecting out->in ports from two processings.
>      * From outside the class (a client class) :
>                OutControl<Foo> controlSender;
>                controlSender.LinkTo( targetProcessing.GetInControl(..) );
>                controlSernder.SendControl( foo );
>
>                I'm writing by heart, so not sure about the interface.
>                LinkTo, etc.
>                Note that the LinkTo can launch an exception -- which is
>                something wanted.
>
> Does it makes sense to you?

Yep, very thanks!

But for client classes this does not add too much overhead? 3 lines of
code when were only 1 and a bit less intuitive. And maybe a bit
confusing, since i see the code more clear if all the outcontrol
members are "processing's outcontrols" , if the user end up defining a
control sender as a class member to manage the issue of sending events
to one of its internal processings (for example to avoid the
instantiation in every Do(), ok is not needed and could be unsuggested
but i think many people will end up trying/doing this in a first
approach).

cheers
-- 
Hernán
http://h.ordia.com.ar
GnuPG: 0xEE8A3FE9




More information about the clam-devel mailing list