Unformatted text preview:

Class DiagramsClassesSlide 3OperationsAttributesSlide 6RelationshipsSlide 8Finding RelationshipsSlide 10Multiplicity and NavigationSlide 12InheritanceSlide 14Page 1Copyright © 1997 by Rational Software CorporationClass DiagramsA class diagram shows the existence of classes and their relationships in the logical view of a systemUML modeling elements in class diagrams–Classes and their structure and behavior–Association, aggregation, dependency, and inheritance relationships–Multiplicity and navigation indicators–Role namesPage 2Copyright © 1997 by Rational Software CorporationClassesA class is a collection of objects with common structure, common behavior, common relationships and common semanticsClasses are found by examining the objects in sequence and collaboration diagramA class is drawn as a rectangle with three compartmentsClasses should be named using the vocabulary of the domain–Naming standards should be created–e.g., all classes are singular nouns starting with a capital letterPage 3Copyright © 1997 by Rational Software CorporationClassesRegistrationFormRegistrationManagerCourseStudentCourseOfferingProfessorScheduleAlgorithmPage 4Copyright © 1997 by Rational Software CorporationOperationsThe behavior of a class is represented by its operationsOperations may be found by examining interaction diagramsregistration formregistration manager3: add course(joe, math 01)RegistrationManageraddCourse(Student,Course)Page 5Copyright © 1997 by Rational Software CorporationAttributesThe structure of a class is represented by its attributesAttributes may be found by examining class definitions, the problem requirements, and by applying domain knowledgeEach course offeringhas a number, location and timeCourseOfferingnumberlocationtimePage 6Copyright © 1997 by Rational Software CorporationClassesRegistrationFormRegistrationManageraddStudent(Course, StudentInfo)CoursenamenumberCreditsopen()addStudent(StudentInfo)StudentnamemajorCourseOfferinglocationopen()addStudent(StudentInfo)ProfessornametenureStatusScheduleAlgorithmPage 7Copyright © 1997 by Rational Software CorporationRelationshipsRelationships provide a pathway for communication between objectsSequence and/or collaboration diagrams are examined to determine what links between objects need to exist to accomplish the behavior -- if two objects need to “talk” there must be a link between themThree types of relationships are:–Association–Aggregation–DependencyPage 8Copyright © 1997 by Rational Software CorporationRelationshipsAn association is a bi-directional connection between classes–An association is shown as a line connecting the related classesAn aggregation is a stronger form of relationship where the relationship is between a whole and its parts–An aggregation is shown as a line connecting the related classes with a diamond next to the class representing the wholeA dependency relationship is a weaker form of relationship showing a relationship between a client and a supplier where the client does not have semantic knowledge of the supplierA dependency is shown as a dashed line pointing from the client to the supplierPage 9Copyright © 1997 by Rational Software CorporationRegistration ManagerMath 101: Course3: add student(joe)RegistrationManagerCourseFinding RelationshipsRelationships are discovered by examining interaction diagrams–If two objects must “talk” there must be a pathway for communicationPage 10Copyright © 1997 by Rational Software CorporationRelationshipsRegistrationFormRegistrationManagerCourseStudentCourseOfferingProfessoraddStudent(Course, StudentInfo)namenumberCreditsopen()addStudent(StudentInfo)namemajorlocationopen()addStudent(StudentInfo)nametenureStatusScheduleAlgorithmPage 11Copyright © 1997 by Rational Software CorporationMultiplicity and NavigationMultiplicity defines how many objects participate in a relationships–Multiplicity is the number of instances of one class related to ONE instance of the other class–For each association and aggregation, there are two multiplicity decisions to make: one for each end of the relationshipAlthough associations and aggregations are bi-directional by default, it is often desirable to restrict navigation to one directionIf navigation is restricted, an arrowhead is added to indicate the direction of the navigationPage 12Copyright © 1997 by Rational Software CorporationMultiplicity and NavigationRegistrationFormRegistrationManagerCourseStudentCourseOfferingProfessoraddStudent(Course, StudentInfo)namenumberCreditsopen()addStudent(StudentInfo)majorlocationopen()addStudent(StudentInfo)tenureStatusScheduleAlgorithm10..*0..*111..*43..100..41Page 13Copyright © 1997 by Rational Software CorporationInheritanceInheritance is a relationships between a superclass and its subclassesThere are two ways to find inheritance:–Generalization–SpecializationCommon attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchyPage 14Copyright © 1997 by Rational Software CorporationInheritanceRegistrationFormRegistrationManagerCourseStudentCourseOfferingProfessoraddStudent(Course,


View Full Document

NJIT CS 602 - Class Diagram

Download Class Diagram
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Class Diagram 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 Diagram 2 2 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?