3.8« Business objects » and « business rules » modeling

« Business objects » are the « Business Rules » (BR) containers. BRs are a set of short and concise business rules. These rules are represented by operations in « Business Object » (BO) class inheriting from an entity class. Operations may come with an OCL (Object Constraint Language) description.

3.8.1BO modeling and applicable rules

Design items

output_html_249bbdd.png Class, stands for an entity.

output_html_m7539fb1b.png Operation.

output_html_4f37ce63.png Operation parameters and return type.

Applicable stereotypes list and modeling rules

  • Ocl_sql

This operation describes a SQL request in OCL.

  • Ocl_impl

This operation describes its implementation in OCL.

  • formula

This operation describes its implementation in Java or .NET.

  • setter

This operation is used to change an object or a data type value.

  • getter

This operation is used to get back an object or a data type value.

  • attach

Used to add an element to a list (association). The method has only one parameter of « List » or « business object » type. The return type must be void.

  • detach

Used to remove an element from a list (association). The method has only one parameter of « List » or « business object » type. The return type must be void.

OCL use for business rules modeling

The OCL may be used to interact on various levels. « Business Rules » may also be used to define SQL specific requests.

OCL constraints list

Body, definition of a condition body executed in the BR.

Rules

  • A « business object » must inherit from an entity.
  • Every operation must be stereotyped.
  • Every operation has a return type.
  • A « setter » stereotyped method must have only one parameter, a « void » return type, and its name must start with ‘set’ followed by an uppercase letter.
  • A « getter » stereotyped method shall not have any parameters, shall not have a « void » return, and its name must start with ‘get’ followed by an uppercase letter.
  • A business object name must be the same as the entity it inherits from followed by the ‘BO’ suffix.
  • A business object may only inherit from one entity at a time.

NULL parameter

The check_null stereotype is used to tell the application to automatically check whether a method parameter is null. If the concerned parameter is null, an ApplicationException is thrown. The Message exception can be specified into the « message » attribute.

Examples

  • Ocl_sql

This operation describes a SQL request in OCL.

output_html_m1417eb6.png

Figure 1 «ocl sql» Applied Stereotype example

output_html_70f8b679.png

Figure 2 «ocl sql» Constraint example

  • Ocl_impl

This operation describes its implementation in OCL.

output_html_21ae3bf1.png

Figure 3 «ocl impl» Applied Stereotype example

output_html_56218f20.png

Figure 4 «ocl impl» Constraint example

  • formula

This operation describes its implementation in Java or .NET.

output_html_m54441a9f.png

Figure 5 « formula » Tag example

  • setter

This operation is used to change an object or a data type value.

output_html_m332a5f62.png

Figure 6 «setter» Applied Stereotype example

  • getter

This operation is used to return an object or a data type value.

output_html_4b9791dc.png

Figure 7 «getter» Applied Stereotype example

  • attach

Used to add an element to a list (association). The method must have only one parameter of « List » or « business object » type. The return type must be void.

output_html_4eb7b649.png

Figure 8 «attach» Applied Stereotype example

  • detach

Used to remove an element from a list (association). The method must have only one parameter of « List » or « business object » type. The return type must be void.

output_html_m2ab1319c.png

Figure 9 «detach» Applied Stereotype example

  • checkNull

Throws an exception if the associated parameter is null

output_html_m241a5a01.png

Figure 10 «check_null» Tag example


BLU AGE is a registered trademark of NETFECTIVE TECHNOLOGY S.A. - Trademarks are property of their respective owners
Do not copy or divulge without written permission