Hey,

The refactoring mentioned in the Envisage thread is now committed. Application instantiation is divided into assembler->model->instance->activate.

This makes it possible to run Envisage on the model instead of the instance. Current Envisage sample startup code now looks like this:
Energy4Java energy4Java = new Energy4Java();
ApplicationModelSPI application = energy4Java.newApplicationModel( new SchoolAssembler());
new Envisage().run( application );
---
No instantiation, and no activation required.

If you instantiate it, then you have an opportunity to set extra metainfo (such as external service instances) before activating the application:
Energy4Java energy4Java = new Energy4Java();
ApplicationSPI application = energy4Java.newApplication(new MyApplicationAssembler());
application.metaInfo().set(new SomeService());
application.activate();
---

This also should make it easier to make the model serializable, so it can be persisted (thus making it possible to skip the assembler->model phase on startup). I started working on it but got stuck on properties which right now holds the constraints instance. This should be fixable though.

All in all, a rather nifty refactoring :-)

/Rickard

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

Reply via email to