Lecture 7 Class Diagrams

Lecture 7 Class Diagrams - Lecture 7: UML Class Diagrams...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 7: UML Class Diagrams CSE 111 01/08/11 1 Copyright W. Howden
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Context After completion of the collaboration diagrams, we have identified class objects that will be needed to perform the subsystem responsibilities We now have the classes for our design From the sequence and collaboration diagram messages, we know what the methods in the classes will be 01/08/11 Copyright W. Howden 2
Background image of page 2
Copyright W. Howden 3 UML Class Diagrams Nodes - Classes Attributes: simple variables Names and signatures of methods Similar to Domain model classes, but + methods Edges – Relationships between classes Association (class A has a class variable of type B) Object visibility Inheritance and aggregation (described later) If diagrams are cluttered, put class details in separate diagrams for each class
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sample Diagram GUI class structure for DS Shows GUI classes and their relationships We will also need DS and DB class diagrams Once the class diagrams are complete, we can begin to code create Java classes corresponding to design classes write the class methods, using the logic in the collaboration diagrams 01/08/11 Copyright W. Howden 4
Background image of page 4
Copyright W. Howden 5 GUIFrame LogOnDialog OptionSelectionDialog SelectDaterPrefsDialog EntermemberDataDialog SelectedDateeDialog MessageDialog DomainLogic <<parameter>> <<Local Variable>> <<attribute>> <<attribute>> Attribute <<parameter>> <<parameter>> <<parameter>>
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Copyright W. Howden 6 +setVisible() +show() +buttonAction(in id : int) +DaterOptionSelectionDialog(in gUIGuiFrame) +getADate: Button +setMemberData: Button -parentFrame: Frame DaterOptionSelectionDialog +show() +setVisible() +LogOnDialog(): LogOnDialog() +buttonAction(in id:buttonID) +OKButton: Button +nameField: TextField -parentFrame: Frame LogOnDialog
Background image of page 6
Object Visibility Object visibility: object x can “see” an object y i.e. x sends a message to y (executes one of its methods) i.e. a method in x calls a method of y x references one of y’s public variables i.e. a method in x references the value of a class variable of y 01/08/11 Copyright W. Howden 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Visibility How can we arrange for the required object visibility to occur in our design? Object visibility is incorporated into an object- oriented design in four ways: attribute, parameter, local variable and global The following examples illustrate ways to incorporate required visibility into a design. First example uses attribute and parameter visibility and the second local variable visibility. 01/08/11
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 31

Lecture 7 Class Diagrams - Lecture 7: UML Class Diagrams...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online