Professional Documents
Culture Documents
UML Origins
A product of the design wars of the 1980s
Grady Booch, James Rumbaugh, and others had competing styles.
95: Rational releases UML 0.8; Ivars Jacobson (use cases) joins RationalThe Three Amigos 96: Object Management Group sets up task force on methods 97: Rational proposed UML 1.0 to OMG. After arm twisting and merging, UML 1.1 emerges 99: After several years of revisions and drafts, UML 1.3 is released
Tom Meyer, Iowa State Meyer@iastate.edu
What UML is
A way to express a software design, mostly through graphical tools Is important for communication, does not specify the process used to reach a design. That process is far more more nebulous Compare it to using circuit schematics and timing diagrams for documenting hardware designs Capture the important details, the art is knowing what to leave out.
Order Customer
dateReceived isPrepaid number : String prince : Money dispatch() close() name address creditRating():String
*
Association Generalization (inheritance)
Class
Attributes
Corporate Customer
contactName creditRating creditLimit remind() billForMonth(Integer)
Personal Customer
creditCard# {creditRating()== "poor"}
Operations
*
sales rep
Multiplicity: many-valued
* Order Line
0..1
Multiplicity: optional
Employee
quantity : Integer price : Money isSatisfied : Boolean
Product
an Order
an Order Line
a Stock Item
Object
* prepare() hasStock:= check()
Message Iteration
Condition
hasStock:= remove() needsReorder:= needsToReorder()
Self-Call
Return
[needsReorder] new
a Reorder Item
[hasStock] new
a Delivery Item
Creation
Deletion
It [a em ll it e R e m ce s iv av ed ai la bl e]
activity
Delivered
transition
Waiting
Delivered
self-transition
state
OOAD
Going to Object Oriented software is not just changing the syntax of the language. It is a new way of organizing software. An object is an instantiation of a class. Just as i can be an instantiation of type integer, x an instantiation of type float and A and instantiation of type char, an object myObj can be an instantiation of a (user-defined) class myClass. An object has a state (specified by values of attributes) and behavior (given by functions, or methods).
OOAD (2)
The idea is to keep as many of the details of the objects functionality inside the object and present only a welldefined interface to the outside world. Open to extending the behavior or the object, but closed to exposing changes inside the object to the outside world. Try to keep one piece of software from depending on changes to another piece.
adcModule init()
tdcModule init()
cpuModule init()
Void initCrate(crateNumber) { // interate over modules Module.init(); } The routine initCrate no longer needs to know what kind of module it is talking to. We could even add a new type of module and it wouldnt care.
simpleTextDb addRecord()
bigFancyOoDb addRecord()
As long as the methods of dbUser refer to the interfaces of myDataBase, they will not care whether we use a simple ASCII text file or a messy object oriented database. We can go from one to the other without changing dbUser.
References
ISBN: 020165783X
ISBN: 0132038374