Add model factory base class backed by Map and Lambda functional object
Implement a new model factory base class that's backed by Map and Lambda functional object.
With following model class.
Developer can use one of the following approach:
At plugin Activator start method, register the model class.
Create an osgi component, at the bind method for the IMappedModelFactory service.
Create a subclass of MappedModelFactory, register as IModelFactory service (DO NOT register as IMappedModelFactory service).
Note that this is still a PR, is not approved yet.
It is an implementation of IModelFactory that’s means to simplify the development of custom model factory for plugin. However, since you will have to create one registration line for each model class, this is probably not the best approach if your plugin have large number of model classes.
The ticket also add a default mapped model factory service that plugin can use to register custom table to model class mapping. This should eliminate the need of many plugin to include a model factory service.
After this have been approved, similar approach will be used for other factories (for e.g process factory) that’s driven by name based mapping.
Hi - sorry for the twenty questions… I want to help others understand the context. Do you see this as a new style of creating plugins in general moving forward, or this specific to models? What is the benefit of this approach over the existing iModelFactory? I will use this information to help create documentation if you wish.
BTW - Thank you for taking the time to help!
Hi , example usage is in the org.idempiere.test/src/org/idempiere/test/model/MappedModelFactoryTest.java unit test class.
Hi - do you have docs or references on this to help understand how to leverage or benefit from this effort? Thanks, Chuck