Download presentation
Presentation is loading. Please wait.
1
October 16, 2001Class Diagrams1
2
October 16, 2001Class Diagrams2 (Design) Class Diagrams (1) zA class diagram is a visual representation of various classes and their relationships as identified during design. zInformation in class diagram includes: yclasses, associations, and attributes yinterfaces with operations and constants ymethods yattribute type information ynavigability ydependencies
3
October 16, 2001Class Diagrams3 Class diagrams (2) zClass diagrams are generally created after or in parallel with the interaction diagrams. zInteraction diagrams are used to identify classes and the methods they provide. zConceptual model is also useful in deriving classes by addition of detail. zClasses are considered software entities and not real-world concepts.
4
October 16, 2001Class Diagrams4 Making class diagrams (1) zIdentify all classes by examining interaction diagrams. zDraw them in a class diagram. zDuplicate the attributes from the associated concepts shown in the conceptual model. zAdd method names by examining interaction diagrams. zAdd type information to the attributes and methods.
5
October 16, 2001Class Diagrams5 Making class diagrams (2) zAdd the associations needed for visibility. zAdd navigability arrows to indicate the direction of attribute visibility. zAdd dependency relationships to indicate non- attribute visibility.
6
October 16, 2001Class Diagrams6 Conceptual model versus class diagrams (1) zA Sale in a conceptual model represents a system concept. A Sale in a class diagram represents a software entity.
7
October 16, 2001Class Diagrams7 Conceptual model versus class diagrams (2) POST captures 11 Sale Date isComplete: boolean time captures 11 POST Date isComplete:boolean time Sale Date isComplete:boolean time makeLineItem() Conceptual model Software components
8
October 16, 2001Class Diagrams8 Class diagrams: notables (1) zcreate is a special language independent UML message to indicate instantiation and initialization. As this is a common operation, it is often omitted from class diagrams. zAccess methods for class attributes are also omitted from class diagrams to reduce clutter. zMessages to a multiobject are not shown as methods in the class whose objects are contained in a multiobject.
9
October 16, 2001Class Diagrams9 Class diagrams: notables (2) zIt is recommended that UML syntax be used for method naming. This will keep naming language independent. UML format: methodName(parameterList) zShould all type information be shown in a class diagram? yIf automatic code generation is desired then YES. yIf the sole purpose is to use the diagram as a communication aid, then all type information is not of any significant value. (See Fig 21.7 of T1.)
10
October 16, 2001Class Diagrams10 Class diagrams: navigability (1) captures 11 POST Date isComplete:boolean time Sale Date isComplete:boolean time makeLineItem() POST will likely have an attribute pointing to Sale. Navigability arrow: POST objects are connected uni-directionally to Sale objects. No navigability arrow..Sale does not have connection to POST.
11
October 16, 2001Class Diagrams11 Class diagrams: navigability (2) zIt is recommended that associations be adorned with navigability arrows. zNavigability is determined by visibility. yA sends a message to B. yA creates an instance of B. yA needs to maintain a connection to B. zExample: Examine Figures 21.9 and 21.10 on pages 266-267. Why are navigability arrows not provided in the conceptual model ?
12
October 16, 2001Class Diagrams12 Class diagrams: dependency zIn UML a dependency relationship indicates that one element has knowledge of another element. zIt is illustrated with a dashed arrow. zNon-attribute visibility…arising from parameters, global, or locally declared items is illustrated by dashed arrows. zSee Figure 21.11, page 268, for dependency relationships.
13
October 16, 2001Class Diagrams13 Class diagrams: other notations zInitial values of attributes zReturn value type zAbstract method zParameters zVisibility
14
October 16, 2001Class Diagrams14 Summary zWhat did we learn? yWhat is a class diagram ? yHow to derive a class diagram from interaction diagrams ? yNotational details for class diagrams.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.