Hi,
Now we have interface-based models and the model objects are supposed to be
created by model factories. And the model implementation and default model
factory classes are subject to being overridden. Therefore, we should try to
avoid hard-coding the instantiation of model implementation and default
model factory classes, for example, don't use new DefaultAssemblyFactory()
or new ComponentReferenceImpl(). This is especially required for the code
that plugs into an extension point. And I expect these classes to receive
the factory instances from constructors or setter methods.
IMO, the factory instances should be made available either from the
ExtensionPointRegistry or the specific extension point. We should "inject"
the correct factory instances during the ModuleActivator.start() or when the
extension is added to the extension point. This way, the desired factories
can be correctly propagated.
At this moment, I still see quite a lot classes which don't follow this
pattern and I think we need to fix it as we're planning to use different
factory implementations to create model instances that also implement
interfaces for runtime behaviors.
Do you agree?
Thanks,
Raymond
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]