How Do You Put Business Rules in a Class Diagram?

Started by hash, November 23, 2008, 10:21:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hash

Hi there,

In the  attachment shows an image of two classes Item ansd Ledger.

Buiness rule say that :
1. "Ledger" can have maximum of 12 "Item" objects
2. In each "Item" object in the "Ledger" there can be maximum of 20 of the same item (Cosnider items such as Books Bikes, Keys, ....if i cosnider an item: Bike, there can be maximum of 100 Bikes....)

Item(max 12 Items)      orders per Item(MAX 100)
Bike                                    4
Books                                  12
Keys                                    100
........
Pen(12th item)                       34


Q:
1. What kind of relationship is this? (the composition that i have put is correct?)
2. How do i put those business rules into a class diagram (we can use only Item class and the Ledger class)

cheers