Open goldhoorn opened 10 years ago
Your example sucks. I am sorry to use this very strong wording, but I really don't see any other way. I'm ignoring the minor syntax errors, but A.def does not exist (did you mean A.use ?). foo and bar do not exist (what do they mean to select).
Moreover, this is IMO unrelated to #23 and #34
To correct my example
define "something", A.use(foo => some_requirement_that_makes_this_non_ambigious)
class A < Syskit ::Composition
add Something_That_needs_to_be_specified_otherwise_its_ambigious, :as => 'foo'
end
class Compo < Syskit::Composition
add A, :as => bla
end
If then Compo get's added because of something, A.foo_child get's ambigious. If you have a larger setup by encapsuling compositions the error got sometimes really confusing because the unspecified Composition (instead of something_def) is choosen automatically.
Why i mention the relation to #23 and #34 is that the automatic selection of InstanceRequirements causes both problems. If no automatic lookup would be done both issues would dissappear from my point of view.
If then Compo get's added because of something, A.foo_child get's ambigious. If you have a larger setup by encapsuling compositions the error got sometimes really confusing because the unspecified Composition (instead of something_def) is choosen automatically.
Isn't that the real problem then ? That the automatic selection does not take into account something_def ? At least it looks like it really is what you find confusing, not so much the automatic selection.
OK, to summarize @goldhoorn's point
And mine:
This is a point for discussion.
I had the strong feeling that fore more and more complex system requirements got ambigious in any case. Therefore most of the requirements have to specified with .use in any case. The Automatic resolution confuses at some points because a non-specified composition is choosen automatically, example:
Then without forwarding, A is choosen automatically without the foo => bar specification. This is oftern (in more system confusing).
A generic resolution could still be done by
in the profile.
I recomment therefore to get completly rid of automatic instance requirements selection. This would solve #34 and #23 too.