Andrejus Explains a Simple Business Logic Groups Example

Andrejus keeps cranking out the examples! His latest posting describes a downloadable sample that utilizes the new capability in 11g called business logic groups (covered in section 4.8 Defining Business Logic Groups of the dev guide).

This feature allows you to define a business logic discriminator attribute whose runtime value can cause a given set of attribute defaults, validation rules, and UI hints to be used. For example, given an employee you might define a business logic group named "CountryGroup" based on the "Country" attribute because there might be different defaults, validation rules, and/or UI hints for employees based on the country they are from. You could create one business logic unit for the "US" value, one business logic unit for the "UK" value and in this way US and UK employees would be treated differently based on this data-driven value. At some future point in time, you could introduce additional business logic units for countries "IT" and "DE", as well.

The business logic units in a business logic group don't have to live in the same package as the entity object that defines the business logic group. In fact, they might not even live in the same project. They provide a slightly more flexible mechanism than the standard discriminator-attribute-based inheritance support we provide because:

  • You can define multiple business logic groups per entity (while Java and ADFBC only allow you to inherit from a single parent).
  • New business logic units can be introduced at any time, perhaps as part of tailoring an application for a particular country (continuing with my example above).
That said, the two mechanisms are not mutually exclusive. You can use normal inheritance with the discriminator attribute as well as one or more business logic groups with their business logic group discriminator attribute in the same entity object.
Comments:

Post a Comment:
Comments are closed for this entry.
About
Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today