Sunday, July 12, 2009

Where does he ItemStatus class would properly Fit in

Part of my Inventory Tracking application i have to Track the history of the status each item wan in.

An item can be in three statuses - IDLE, IN-USE and IN-TRANSIT.

Therefore I have draw a sketch of the ItemStatus class

 

                                              image

 

Also I have drawn a sketch of the Item class as:

 

                                    image

 

I have added a reference "allMyStatusHistories" to ItemStatusHistoryTracker class.

 

To complete, I have added a class "ItemStatusHistoryTracker" class to handle Histories of all the statuses that an Item was in

 

                                                 image

 

I have create the relationship between the "Item" and "ItemStatusHistoryTracker"

 

                                        image

 

The business rules I have considered when creating this relationship is:

1. Item has at least one Item’s history of statuses (History) or many histories

2. One Item can have One-to-Many (it’s ) status histories

3. In One Item’s status history there can be only one Item.

The problematic part: creating a link with the "ItemStatus" structure (consider as a class for now)

 

I can consider the following possible business rules:

  • An Item has a Status

Therefore I've create a relationship as:

 

                image

 

I have added "myStatus" as the reference to "ItemStatus".

  • "ItemStatus"is part of "temStatusHistoryTracker" (a composite relationship)

 

              image

 

Therefore I cannot figure out where this "ItemStatus" should fit with classes, "Item" and

"ItemStatusHistoryTracker".

Therefore, please give me guidance to redraw the relationship between three classes!

FYI - In the database, their relationships are shown as:

 

image

No comments:

Post a Comment