210 likes | 396 Views
OOD - Principles Design Class Diagrams. Chapter 10 pp. 295-298; 304-314; 317-320. Where are we?. OOD: Object-Oriented Design. From "Domain Classes " to "Programming Classes" Specify objects to carry out each use case. From Requirements (Analysis) to Design…. Ch10. Ch11.
E N D
OOD - Principles Design Class Diagrams Chapter 10 pp. 295-298; 304-314; 317-320
OOD: Object-Oriented Design • From "Domain Classes" to "Programming Classes" • Specify objects to carry out each use case
From Requirements (Analysis) to Design… Ch10 Ch11
Design Class: Things to Know • Elaborate attributes • Define Method types • Write Method Signatures • Identify Instance-Level and Class-Level Attributes & Methods
Elaborating Attributes visibilityattributeName: dataType {property} • Visibility • Public or Private • Data type • Numbers: integer, double • Text: string • True/False: boolean • Dates: dateTime • Property • key
Method Types • 3 Method types • Constructor methods • Accessor methods • Get • Set • Processing methods
Method Signatures visibilitymethodName(parameterList) : returnType • Visibility • Public or Private • Method name • Verb phrase • Paramater List • Inputs • Return Type • Output • Typical data type: interger, string, etc • Object (e..g Student) • Collection of objects: StudentArray
Instance-Level vs. Class-Level Attributes & Methods • Instance-Level • Pertains to an indvidualobject/instance • Attribute name • Method getName(), calcGPA() • Class-Level • Does not pertain to an indvidualobject/instance • Attribute tuitionPerHour • Method findAboveHours() -tuitionPerHour: integer
Exercise • Design a Design Class for: Vehicle • Attributes • Primary Key • Instance attribute • Class Attribute • Method • Constructor method • Instance Method • Accessor methods (2) • Processing method • Class Method
Design Class Diagram Overridden Method
Review – let’s understand this Use Case before continuing • Use Case Description • “Process New Order”
Review – let’s understand this model before continuing • Domain Class Diagram
Steps: Initial Design Class Diagram • Select a Use Case: “Process New Order” • Add Domain Classes • See pre-conditions & post-conditions for ideas • Elaborate Attributes: visibility, data types
Steps: Initial Design Class Diagram • Add a "Controller" class • Switchboard between the View & Domain Layer; a collection point for incoming messages. Include one per use case.
Steps: Initial Design Class Diagram • Add Navigation Visibility • (def) the ability of one object to interact with another Rules • 1 to Many Association • 1 * • Mandatory Associations • IndepDependent • Needs info • Sender Receiver
Steps: Initial Design Class Diagram • Add Methods (will see this in Ch 11 via Sequence Diagrams) • That is, Behavior!