Unformatted text preview:

Information Systems Analysis and Design CSC340 III Class and Object Diagrams Classes Attributes and Operations Objects and Multi objects Generalization and Inheritance Associations and Multiplicity Aggregation and Composition Business Objects and Rules 2004 John Mylopoulos Class Diagrams 1 Information Systems Analysis and Design CSC340 Classes A class describes a group of objects with similar properties attributes common behaviour operations common relationships to other objects and common meaning semantics Finding classes Listen to the domain experts the people who know the domain you are modeling 2004 John Mylopoulos Class Diagrams 2 Information Systems Analysis and Design CSC340 Diagrammatic Notation for Classes Modeling the real world StaffMember Name mandatory staffName Attributes optional CalculateBonus ChangeGrade Operations optional 2004 John Mylopoulos Class Diagrams 3 Information Systems Analysis and Design CSC340 System Classes This is a Java class to be included in the design of the new system StaffMember staffName CalculateBonus ChangeGrade 2004 John Mylopoulos Class Diagrams 4 Information Systems Analysis and Design CSC340 Attributes Each class can have attributes which represent useful information about instances of a class Each attribute has a type type For example Campaign has attributes title and datePaid Campaign title String datePaid Date 2004 John Mylopoulos Class Diagrams 5 Information Systems Analysis and Design CSC340 Objects are Class Instances SaveTheKids Campaign title Save the kids datePaid 28 01 02 2004 John Mylopoulos Class Diagrams 6 Information Systems Analysis and Design CSC340 Object Diagrams Student Jaelson Instructor BillClinton Course Monica Student courseNo csc340 description OOAD someone 2004 John Mylopoulos Class Diagrams 7 Information Systems Analysis and Design CSC340 Multiobjects A multiobject is a set of objects with an undefined number of elements p2 Instructor c1 Course c3 Course c2 Course Student Student Multiobjects 2004 John Mylopoulos Class Diagrams 8 Information Systems Analysis and Design CSC340 Operations Often derived from action verbs in the description of the application Operations describe what can be done with the instances of a class 2004 John Mylopoulos Class Diagrams 9 Information Systems Analysis and Design CSC340 Operations Campaign Title String CampaignStartDate Date CampaignFinishDate Date EstimatedCost Money ActualCost Money CompletionDate Date DatePaid Date Completed CompletionDate Date ActualCost Money SetFinishDate FinishDate Date RecordPayment DatePaid Date CostDifference Money 2004 John Mylopoulos Class Diagrams 10 Information Systems Analysis and Design CSC340 Visibility As with Java attributes and operations can be declared with different visibility modes public public any class can use the feature attribute or operation protected protected any descendant of the class can use the feature private private only the class itself Staff can use the feature public name String passwd String dateofB Date private protected ChangePasswd Include 2004 John Mylopoulos Class Diagrams 11 Information Systems Analysis and Design CSC340 Relationships Classes and objects do not exist in isolation from one another A relationship represents a connection among things In UML there are different types of relationships Generalization Association Aggregation Composition more 2004 John Mylopoulos Class Diagrams 12 Information Systems Analysis and Design CSC340 Generalization StaffMember staff Integer name String startDate Date grade Hire ChangeGrade CalculateBonus AdminStaff Hire CalculateBonus Superclass or parent Subclasses or children CreativeStaff qualifications Hire CalculateBonus 2004 John Mylopoulos Class Diagrams 13 Information Systems Analysis and Design CSC340 Inheritance Inheritance of attributes Inheritance of operations Overriding inherited attributes or operations 2004 John Mylopoulos Class Diagrams 14 Information Systems Analysis and Design CSC340 Advert Finding Inheritance Hoarding Advert Press Advert Video Advert Billboard Newspaper Advert Magazine Advert 2004 John Mylopoulos Class Diagrams 15 Information Systems Analysis and Design CSC340 Finding Inheritance Bottom Up Book title author publisher ISBN DeweyCode acquisition Loan Return 2004 John Mylopoulos RecordCD title catalogue publisher artist acquisition Loan Return Class Diagrams 16 Information Systems Analysis and Design CSC340 LoanItem title acquisition Loan Return Better All classes in this diagram model real world entities Book Author DeweyCode publisher ISBN Record artist catalogue recordCo 2004 John Mylopoulos Class Diagrams 17 Information Systems Analysis and Design CSC340 Generalization Notation Possibly overlapping Maria is both Lecturer and Student Person Student 2004 John Mylopoulos Lecturer Mutually exclusive a lecturer can t be a student and vice versa Person Student Lecturer Class Diagrams 18 Information Systems Analysis and Design CSC340 Classification This is the relationship between an object and the classes of which it is an instance Traditional object models assume that classification is single and static Multiple classification allows an object to be an instance of several classes that are not is a related to each other for example Maria may be an instance of GradStudent and Employee Dynamic classification allows an object to change its type during its lifetime 2004 John Mylopoulos Class Diagrams 19 Information Systems Analysis and Design CSC340 Multiple Classification TA Male Person Female sex mandatory student Professor role dynamic Student Staff 2004 John Mylopoulos Class Diagrams 20 Information Systems Analysis and Design CSC340 Association Relationships name StaffMemder manages name manager staff startDate qualification Campaign title startDate estimatedCost role 2004 John Mylopoulos Class Diagrams 21 Information Systems Analysis and Design CSC340 Association Multiplicity How many instances of a class can participate in an association of a particular type StaffMemder name staff startDate qualification Campaign title 0 startDate estimatedCost manages 1 A staff member can manage zero or more campaigns 2004 John Mylopoulos Each campaign is managed by exactly one staff member Class Diagrams 22 Information Systems Analysis and Design CSC340 Multiplicities Some examples of specifying multiplicity Optional 0 or 1 0 1 Exactly one 1 1 1 Zero or more 0 One or more 1 A range of values 1 5 A set of ranges 1 3 7 10 15 19 2004 John Mylopoulos Class


View Full Document

Toronto CSC 340 - Class and Object Diagrams

Documents in this Course
Scoping

Scoping

10 pages

Load more
Loading Unlocking...
Login

Join to view Class and Object Diagrams and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Class and Object Diagrams and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?