Anda di halaman 1dari 3

Business Rules and UML.

Business rules affect systems in a plethora of UML locations. When it


comes to UML there are various locations where they may “live”. It is the
purpose of this paper to define where and what form these business rules
may take. The following forms are in table 1 below:

Note the verification of the business rules should be achieved by a


non-implementation prototyping tool such as flex. This allows active
verification with the subject area expert (user).

UML Location Rationale and form Notes


Within a normal It may be defined as an With either of these
class attribute of a special type options the attribute is
e.g. : defined in the format
MultibuyPrice: of a rule.
rule For example
or it may be deferred by MultibuyPrice:= If
means of a derived Quantity = 6 then
attribute: Charge:=
/Price
Quantity*UnitPrice*0.66.
/Price := tariff-
(rate*duration +
damage) + tax
Within a singleton This could be an invariant Invariants are
class applicable to the whole expressed as a rule that
enterprise. will always be true!
It could also be expressed e.g Reservation date
as a Decision table (data must be non historic!
type)
Within a Use case This may be expressed as Within a Use case it
a condition or rule could be:
OR Dose calculation =
it may be access to a <Decision
Decision table. table(<Condition
entry-set>)
Amongst objects This may be expressed in If one has 1 ward one
the form of associations may have multiple
patients.
It can also suggest
instances of
associative classes.
Within a State A State model may This is representing

Business rules and UML.doc 1 21/11/2005


model express operational rules the viable
of behaviour for instances combinations and
of a class. sequences of
behaviour.
Within an activity An Activity model may This is representing the
diagram express operational rules viable combinations
of behaviour within a and sequences of
procedure or group or behaviour.
sub-set of procedures.
Table 1

Decision tables will usually have the form:

Condition stub
Patient > 65 Y N Y Y N
Patient diabetic Y N N Y N
Patient Y N N N Y
Overweight
Credit rating Y N O O O
+ve
Action stub
Dose= X
Weight*coefficient1
Dose:= 124 X
Dose:= 129 X
Dose:= 121 X
Dose:= X
Weight*Lambda

This can be stored as a special data type e.g.

Dosage:Decision table

or even as an Abstract Data Type,


and it will have access mechanisms:

access Dosage(<Condition entry set>):


<action_stub>

The Action stub is the returned value.


A similar protocol can be used by a Use case text:

Dose=

Business rules and UML.doc 2 21/11/2005


Including (Dosage(Condition entry set)).

This assumes that the condition entry set is populated with

Patient diabetic, overweight, credit rating etc.

Business rules and UML.doc 3 21/11/2005

Anda mungkin juga menyukai