MBO Performance Tip N.3 – Be light in Mbo initialization methods

This entry is part of the Java MBO performance optimization golden rules series.

The initValue() method is the first method executed after the MBO constructor. It is typically used to initialize attributes on new records and to set default values.
The init() method is called after initValue(). It is typically used to set current attribute as read-only based on some condition.
Do not query the database or do any other expensive logic in the initValue() and init() methods.
Setting MBO or field flags that require expensive operation or fetching other needed MBOs should be done in initFieldFlagsOnMbo().

This rule should also be applied in field initialization methods. Do not initialize the value of a field in the initValue() method of another field. Each field should initialize itself in its own initValue() method.

MBO Performance Tip N.3 – Be light in Mbo initialization methods

One thought on “MBO Performance Tip N.3 – Be light in Mbo initialization methods

  1. Hello Bruno,
    Is there a way to know inside initFieldFlagsOnMbo() that we are on the list tab and not on other main tab ? We would like to ignore some expansive initialization logic when on the list tab. (Our field can't be removed from the list).
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top