On 6/3/11 7:23 , Stanislav Muhametsin wrote:
Whatever happened to this? I'm still getting ambiguous type exceptions,
when I'm invoking newObjectBuilder(Class) -method of
ObjectBuilderFactory. And I have registered both super- and subtypes to
module assembly.

Original mail from 18th Feb.

I noticed this as well, and also thought this was fixed. I definitely recall fixing it, but now that I look there was no fix. Weird.

In any case, when looking into this again I noticed that one of the main problems with the Qi4j runtime is that it is almost impossible to follow the algorithms and verify what they are supposed to do. The visitor pattern made things really really complicated, unfortunately.

So, with the latest additions of functional programming that I've done in Qi4j, I made a spike to test and see if the runtime could be rewritten as a functional system instead. To make a long story short, not only did it work, but the algorithms are now vastly simpler, more efficient, easier to read. Some of the algorithms literally disappeared, such as the service dependency injection code (which is now simply a call to the existing ServiceFinder code). All of the central concerns, such as visibility, are now implemented in one place only, and various usecases then add their specific needs, as close to the usecase start as possible.

Some things becomes vastly more efficient this way as well, due to the structure being simplified and due to constructions such as first(iterable), which cancels an execution once a result has been found (this is VERY common). Lots of code that duplicated the visibility rules have been discarded in the process.

It is now possible to easily follow function execution by reading the code and also debugging is simpler, which should make it easier to add new features as necessary.

I'm currently finishing this up, and making sure all tests still work.

/Rickard

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

Reply via email to