Geer, Christopher S wrote:

Ok, let me try and restate what I think I read.

We define the lifecycles as delegates for example:

delegate void Service( IServiceManager manager );

We also define some lifecycle attribute, for example:

[AvalonLifecycle("Serviceable")]

which a component would define on the method that matches the
corresponding delegate definition, for example:

   [AvalonLifecycle("Serviceable")]
   public void MyServiceMethod( IServiceManager manager) {}

Then at runtime, when a component is deployed, the container would
reflect over the component looking for the set of attributes and setting
up the delegates then.

Did I get that right? I think that might just work. My only concern with
it is the container would have to check every method in the component to
see what lifecycles it uses instead of just checking the class
definition for interfaces.

Yep. You got it right.


The point you raised is valid, but its affect is minimized by two things:

1) we only need to check public methods.
2) the only affect is at load time.  We can store the results of the
   reflection in the delegates.  The container can then easily call
   the delegate methods as often as needed without having to "reparse"
   the component.


Ok make it two concerns, also, given this approach, if the component
maker defined the MyServiceMethod incorrectly (didn't match the
delegate) the mistake wouldn't be caught at compile time because the
delegate wouldn't actually be created until it is deployed. This could
just increase the test/debug cycle a bit. This makes it a bit awkward.

That is another issue. Considering that we haven't released Avalon# yet, this makes it a good test ground for what will and won't work for Avalon 5.

I suppose for NUnit2 the impact is minimal because the methods are
always no-arg.

Which would you prefer seeing?



--

"They that give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."
                - Benjamin Franklin


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to