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.

Example Usage:

With following model class.

Developer can use one of the following approach:

  1. At plugin Activator start method, register the model class.

  2. Create an osgi component, at the bind method for the IMappedModelFactory service.

  3. Create a subclass of MappedModelFactory, register as IModelFactory service (DO NOT register as IMappedModelFactory service).




Heng Sin Low
January 28, 2021, 1:47 PM

Hi ,

  1. Note that this is still a PR, is not approved yet.

  2. 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.

  3. 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.

  4. 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.



Chuck Boecking
January 28, 2021, 1:27 PM

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!

Heng Sin Low
January 28, 2021, 8:12 AM

Hi , example usage is in the org.idempiere.test/src/org/idempiere/test/model/ unit test class.

Chuck Boecking
January 27, 2021, 1:38 PM

Hi - do you have docs or references on this to help understand how to leverage or benefit from this effort? Thanks, Chuck



Heng Sin Low


Heng Sin Low



Tested By



Fix versions