First page Back Continue Last page Text

oracle adf workshop


Using Inheritance in the Business Domain Layer

Inheritance is a powerful feature of object-oriented development that can simplify development and maintenance when used appropriately. ADF Business Components supports using inheritance to create new components that extend existing ones to either add additional properties or behavior or modify the behavior of the parent component.

To set up an inheritance hierarchy, you can define one EO to serve as the base class. This EO should contain the attributes that are common to all such entities. You can remove the attributes that are particular to only one type of object.

For example, your schema may have a table called Persons, with a field called Person_Type, which indicates whether the person is a customer or employee. From this table, you can set up an entity called PersonEO. If you have rules and methods that differ between a customer and employee or different associations or attributes, extend this EO and create separate Entity Objects called CustomerEO and EmployeeEO.