[cecilia] automatic BC code generation for 'collection' bindings...
Currently, BCdelegate and defaultComposite (Cecilia runtime) implement the BC methods for cardinality="singleton" bindings only. BC methods for cardinality="collection" bindings have to be implemented by users (even if they don't plan on modifying the application's architecture at runtime): user code needs a way to call the components on the server side of the binding.
We could ease users' lives, at least for two simple use cases:
- a constant number of components (n..n cardinality) which aren't rebound by user code at runtime. In this case, currently, users have to implement a bindFc() method that will be used only by the internal initialization code (!);
- a bounded number of components (n..m cardinality), which may be rebound by user code at runtime, as long as correct operation of the component on the client side of the binding doesn't depend on the number and the order of bindings (so that the generated code is free to use any algorithm for bindFc and listFc).
Complex runtime rebindings of an unbounded number of components are probably best left to users, IMO...
The internal implementation details of the two BC I mentioned above should be hidden to users. Therefore, we have to provide users a means of accessing the components on the server side of the binding. We could add at least one new macro... but I think we can simply flatten a collection binding of bounded cardinality into the _importeds" structure, and access the components on the server side of the binding through REQUIRED.itfName[number].
Note that in the Cecilia-newmacros version of Comanche, we did exactly this: flattening (by hand) the cardinality="collection" binding of Dispatcher, so as to make it optimizable by static binding & component merging optimizations. (but we're programmers, so we're lazy, and it would therefore be great if the toolchain did the work for us :D)
Thoughts ? I know that at least two persons besides me had to implement a BC for cardinality="collection" bindings, so I'd rate this feature as important.