#490 M-Class Factory


In order to facilitate creation of Compiere extensions
I suggest that the way new M-Class objects are created
in code is changed to a Factory-type approach.

Currently the GUI nicely supports custom M-Classes if
they are correctly named and placed in package
"compiere.model". However, it is currently not possible
in the same way to make the standard Compiere code use
a customized M-class.

Today an MClass object is created by the code:
new MOrder(ctx, ID)

However, this means that the standard Compiere code
will always use the org.compiere.model.MOrder, even if
a compiere.model.MOrder object exists.

I suggest to everywhere in Compiere use a ModelFactory
which has some logic to check whick MClass to instantiate.

This is a considerable change to the code, but would
facilitate the creation of extensions and
customizations enormously.


  • Jorg Janke

    Jorg Janke - 2005-05-09
    • status: open --> pending
  • Jorg Janke

    Jorg Janke - 2005-05-09

    Logged In: YES

    You should only touch the system model classes if there is
    no alternative - and then bear the costs. The best option is to
    use the model listener.

  • Kathy Pink

    Kathy Pink - 2005-10-14
    • status: pending --> closed

Log in to post a comment.