Business Modeling
The purpose of the business modeling activity in RUP is to:
- Capture the structure and dynamics of the business for which the system is being developed
- Derive the functional requirements for the system
- Understand problems and identify potential improvements in the business process
There are several artifacts produced during business modeling. Of particular interest from a business rules perspective, are:
- Business Glossary - Defines terms that are important to the business
- Business Rules - Declarations of policy and constraints
- Business Object Model - Identifies the core entities of interest to the business and the relationships between them.
The RUP Business Rules artifact is captured as a single document containing the definition of the business rules. RUP allows business rules to be specified in the business rules document using a number of options. These include:
- Object Constraint Language (OCL)
- Near English
- UML models
The RUP Business Rules Guidelines provides guidelines on how to express business rules graphically in the various UML models.
A summary of how to express the various types of business rules using different UML diagrams is provided in Table 2.
| Property | Description |
|---|---|
| Use Case | Model the relationship between actors and the use-cases of the system |
| State | Model the lifecycle of an object, including its possible states and the transitions between states |
| Class | Model the major entities in the system and their static relationships |
| Object | Model snapshots of the object instances of a system at a particular point in time |
| Sequence | Model the dynamic interactions between objects of the system |
| Collaboration | Same as sequnce diagram but with a different view |
| Activity | Model the activities that occur during the realization of a use case scenario |
| Component | Model the physical implementation of a system in terms of components and their dependencies |
| Deployment | Model the allocation of software components to hardware resources |
Table 2: How to express business rules using UML
In practice, using UML class diagrams to express business rules is not very effective. This is a problem of object-oriented (OO) design as much as a problem with UML. Amongst the major design principles of OO design are the principles of abstraction and encapsulation. A class is an abstract representation of some concrete entity (e.g. Customer) and encapsulates the data related to the abstraction in question, along with the methods or operations that manipulate that data. There are many instances of business rules that do not fit cleanly within a single class. For example, a business rule calculation may require data from two or more classes. Following good OO design principles, the definition of such business rules will end up being spread amongst multiple classes. This makes it harder to verify the correctness of the business rule.
Another problem with using UML to capture business rules is that UML diagrams in themselves are not adequate to express all business rules. To help alleviate this, the OMG has adopted the Object Constraint Language (OCL).
The OCL is a declarative language that allows constraints to be added to UML models to help remove ambiguity from the diagrams. OCL expressions use a formal syntax to specify constraints.
