Pier Fumagalli wrote:

[...]

I guess I got this wrong - isn't this distinction based on
the difference between compile time / runtime? My component
will use a logger and a configuration in any case, but maybe
it doesn't know which services it will need later on. When it
"requires" each other block it might want to use, wouldn't
this generate some overhead?


You declare your requirement in the descriptor, but access the instance at runtime...

I'm not concerned about the access mechanism, but about the selection mechanism. The block should be given a specific instance of a Generator (for example) if they require one. But they should not be allowed to look up for a ComponentSelector upon which the block itself "chooses" which one of the generator it wants...

OK, so you mean it shouldn't be possible to choose among several Generators using a specific hint? I must admit that I never really felt comfortable with the concept of hints. When you define the behaviour of a component using an implementation-independent interface, don't you bypass this concept when you obtain a specific implementation using a hint?

It is obvious that an implementation should be chosen based on
certain priorities (speed, memory consumption, ...) - how would
this be managed without selection?

Thanks for your explanations!

-- Andreas



Reply via email to