130 likes | 238 Views
OO Design. Roshan Chitrakar. Design Class Diagrams (DCD). DCD provides details of the software classes along with methods. DCDs are created in parallel with interaction diagrams or after them in rare cases.
E N D
OO Design Roshan Chitrakar
Design Class Diagrams (DCD) • DCD provides details of the software classes along with methods. • DCDs are created in parallel with interaction diagrams or after them in rare cases. • In practice, the creating the DCD begins with drawing a little of Interaction diagram and making DCDs. Then update Interaction diagram and then update DCDs.
Creating DCDs • Identify software classes • Illustrate them by Class Diagrams • Add Method names • Add Type information • Add Association and Navigability • Add Dependency relationship
Identify Software Classes and Illustrate them by Class diagrams • Scan interaction diagrams and list all the classes • Some of the domain classes may be absent here • Some may appear later in the elaboration phase or when a new requirement is added
Add Method Names Go through the interaction diagrams and make a list of all the messages. Generally, messages coming to a class become methods of the class.
Method Name Issues • The message create • Accessing Methods • Multi-objects • Language dependent syntax
Add Type Information • Types of attributes, Parameters of methods and Return values are specified Note: All information must be added exhaustively if CASE tools will be used for code generation.
Add Associations and Navigability • A role should be given uni-directional capability to navigate from source to target objects of classes. • Navigability usually implies the attribute visibility. (shown by a line and an arrow) • Navigability can also be identified from Interaction diagrams • (p294, Larman) • (p293, Larman)
Add Dependency • Dependency is illustrated with dashed arrow line (UML notation) • It depicts non-attribute visibility (e.g. parameter, local, global visibility) also. • So, it is recommended when local, parameter or global visibility exist among classes.