Shanghai Jiao Tong University 上海交通大学 Object Oriented Analysis and Design Class Diagrams 上海交通大学软件工程中心
Shanghai Jiao Tong University 上海交通大学软件工程中心 Object Oriented Analysis and Design Class Diagrams
Outline ★◆Class diagrams Class relationships -Association Aggregation ■6 Generalization Object Oriented Analysis and Design 2
Object Oriented Analysis and Design 2 Outline Class diagrams Class relationships ▪ Association ▪ Aggregation ▪ Generalization
What Is a Class Diagram? ◆ Static view of a system CloseRegistrationForm Schedule CloseRegistrationController semester is registration open?() +open() commit() close registration() close registration() select alternate() remove offering() Professor level() name Student cancel() get cost() employeelD Uniqueld delete() hireDate get tuition() submit() status add schedule() save() -discipline get schedule() any conflicts?() maxLoad delete schedule() create with offerings() has pre-requisites() update with new selections() submitFinalGrade() acceptCourseOffering() setMaxLoad() takeSabbatical() Object Oriented Analysis and Design 3
Object Oriented Analysis and Design 3 What Is a Class Diagram? Static view of a system CloseRegistrationForm + open() + close registration() Student + get tuition() + add schedule() + get schedule() + delete schedule() + has pre-requisites() Schedule - semester + commit() + select alternate() + remove offering() + level() + cancel() + get cost() + delete() + submit() + save() + any conflicts?() + create with offerings() + update with new selections() Professor - name - employeeID : UniqueId - hireDate - status - discipline - maxLoad + submitFinalGrade() + acceptCourseOffering() + setMaxLoad() + takeSabbatical() CloseRegistrationController + is registration open?() + close registration()
Class Diagram Usage When modeling the static view of a system, class diagrams are typically used in one of three ways,to model: The vocabulary of a system ■ Collaborations A logical database schema Object Oriented Analysis and Design 4
Object Oriented Analysis and Design 4 Class Diagram Usage When modeling the static view of a system, class diagrams are typically used in one of three ways, to model: ▪ The vocabulary of a system ▪ Collaborations ▪ A logical database schema
Example:Class Diagram Is there a better way to organize class diagrams? LoginForm RegistrationController RegisterForCoursesForm Schedule CloseRegistrationForm CloseRegistrationController Professor Student Course CourseOffering CourseCatalogSystem BillingSystem Object Oriented Analysis and Design 5
Object Oriented Analysis and Design 5 Example: Class Diagram Is there a better way to organize class diagrams? CloseRegistrationForm LoginForm Professor BillingSystem CloseRegistrationController RegisterForCoursesForm Course CourseCatalogSystem Student RegistrationController CourseOffering Schedule