Thanks for the info. Let me add a more clear example and see if your answer still applies.
@ComponentFactory(name="SomeComponentFactory")
@Property("part","part", "A")
@Property("type", "type", "json")
@Requires("config", "config", spec_filter="(usable=True)")
@Provides(specifications="some.component")
class SomeComponentA(object):
...
@ComponentFactory(name="SomeComponentFactory")
@Property("part", "part", "B")
@Property("type", "type", "json")
@Requires("config", "config", spec_filter="(usable=True)")
@Provides(specifications="some.component")
class SomeComponentB(object):
...
@ComponentFactory(name="UserComponentFactory")
@Requires("comp", "some.component", spec_filter="(part=A)")
class UserComponent:
...
In UserComponent I can add a selector (part=A) to select the appropriate Factory and instantiate SomeComponentA.
It sets part=A on the new instance which could be SomeComponentB. It doesn't use the passed in properties as a selector the way the decorator does.
I couldn't see a way to provide property selectors using ipopo.instantiate.
Hope this helps. Thanks for your suggestions.