On 7/4/11 08:41 , Niclas Hedhman wrote:
Now, i wonder:
- is this the only way to validate an assembly ?

Yes, no other way is currently available.

- Casting down exceptions in order to gracefully degrade from (expected)
assembly errors is not really fun&  rich of information. - any opinions on
that ?

AFAIK, there is no way to 'gracefully degrade' from an invalid model,
as Qi4j Runtime aborts all further model building when an exception
occurs.

One thing on the 'wishlist' from me for the future is to get the full
error report in one go, instead of the piecemeal servings one gets
now. Explain your use-case, and we could take a look at it.

Agreed. One of the goals of the 2.0 refactoring is to make it easier to have assembly contain only things for the model (and not imported service instances, for example), so that it becomes easier to run the assembly to build the model, and then visualize it, in IntelliJ or elsewhere. Having exceptions come one at a time would simplify this, definitely.

In 2.0 I'm refactoring the initialization process to have roughly three phases:
1) Assembly - any exception here will instantly abort
2) Binding - in this phase the model is traversed and "bound" (e.g. mapping methods to mixins, making sure that @This injections are correct, etc.), and so it would actually be quite simple to gather up all the exceptions and present them together.
3) Instantiation

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to