Design? !… When it needs? To understand, to communicate with customers Complex problem What is good design? Separate What to do?(Policy) and How to do(mechanism) How to represent? modeling
What is a model? Abstraction for understanding!. To deal with the complexity of the problem Want to build model, verify the model satisfying the system requirements implement by adding details easy to communicate with customers and/or among designers How it is possible? Do abstraction by isolating important aspects for some purpose for some purpose and suppress those unimportant aspects Inherently, not complete. Seek for adequacy for some purpose. What is the good medium for modeling? Is computer language a good vehicles for modeling? UML
Models? Class model, state model, interaction model Class model Structure of objects in systems (identity, relationship to other object, attributes, operations) Provide context for state and interaction model Capture the static structure of the system by characterizing objects, the relationship among objects, the attributes and operations for each class of object. Class model represents static, structural data aspects of a system State model represents temporal behavioral control aspect Interaction model represents the collaboration of individual objects, the interaction aspects. Modeling with Class model?
Object? A concept, abstraction or thing with identity that has meaning for an application (distinguishable) Class? Blueprint? Describes a group of object with same attributes, operation and relationship. Define class and object is enough? Vague, insufficient We need vehicles that are coherent, precise and easy to implement. Class diagram and object diagram Class diagram : a graphic notation for modeling classes and their relationship good for abstract modeling and design Object diagram: for showing individual objects and their relationships good for documenting test cases and discussing examples.
UML Class:Box, Bold case, center, start with Capitals. Singular noun ObjectName:ClassName
Values and attributes Value:data Attributes: named property of a class that describes value held by each object of the class 2 nd compartment
Unique identifier (implicit in a class model) Purely implementation convenience with no application meaning Social security no, telephone no, etc
Operation: function or procedure that may be applied to or by objects. Method: implementation of an operation for a class 3 rd compartment Direction of data In, out, inout
Link and Association Link: physical or conceptual connections among object Association: description of a group of links w/ common structure and common semantics Italic multiplicity If link has name, underlined
Association end name Optional Necessary between object in same class
Regard many association ends as a set Sometimes object have an explicit order
Binary association, yet permit multiple link for a pair of object, duplication allowed
Links of an association with attributes! Association class attributes Dashed line
One to one or one to many
Small box Disambiguates the object for many association ends
Generalization Relationship between superclass and subclass Inherits Point to superclass { means there are additional subclass}
Polymorphism Generalization set name Aspect of object being abstracted