Software Engineering UML Class Diagrams 1 Step 1

  • Slides: 19
Download presentation
Software Engineering UML Class Diagrams 1

Software Engineering UML Class Diagrams 1

Step 1 The first step is to obtain or prepare a textual description of

Step 1 The first step is to obtain or prepare a textual description of the problem to be solved. Step 2 Examine the description and underline nouns. The nouns will become classes in the analysis.

Step 2 Examine the description and underline nouns. The relevant classes in the system:

Step 2 Examine the description and underline nouns. The relevant classes in the system: 1. The registration manager sets up the curriculum for a semester using a scheduling algorithm. 2. One course may have multiple course offerings. 3. Each course offering has a number, location, and a time associated with it. 4. Students select four primary courses and two alternative courses by submitting a registration form. 5. Students might use the course management system to add or drop courses for a period of time after registration. 6. Professors use the system to receive their course offering rosters. 7. Users of the registration system are assigned passwords which are used for login validation.

Classes: Registration. Form Registration. Manager Scheduling. Algorithm Course Professor Student Course. Offering

Classes: Registration. Form Registration. Manager Scheduling. Algorithm Course Professor Student Course. Offering

Step 3 Examine the description and underline adjectives in the document. These adjectives will

Step 3 Examine the description and underline adjectives in the document. These adjectives will describe the attributes of the classes that we previously identified. 1. The registration manager sets up the curriculum for a semester using a scheduling algorithm. 2. One course may have multiple course offerings. 3. Each course offering has a number, location, and a time associated with it. 4. Students select four primary courses and two alternative courses by submitting a registration form. 5. Students might use the course management system to add or drop courses for a period of time after registration. 6. Professors use the system to receive their course offering rosters. 7. Users of the registration system are assigned passwords which are used for login validation.

Class: Course. Offering number location time

Class: Course. Offering number location time

Step 4 • Analyze the active verbs in the description. • The active verbs

Step 4 • Analyze the active verbs in the description. • The active verbs will give us the operations (methods) that we'll need to define for our classes. 1. The registration manager sets up the curriculum for a semester using a scheduling algorithm. 2. One course may have multiple course offerings. 3. Each course offering has a number, location, and a time associated with it. 4. Students select four primary courses and two alternative courses by submitting a registration form. 5. Students might use the course management system to add or drop courses for a period of time after registration. 6. Professors use the system to receive their course offering rosters. 7. Users of the registration system are assigned passwords which are used for login validation.

Step 4: Add Operations Registration. Manager add. Student(Course, Student) Course. Offering name number. Credits

Step 4: Add Operations Registration. Manager add. Student(Course, Student) Course. Offering name number. Credits number location time open() add. Student( Student)

Classes Scheduling. Algorithm Registration. Form Registration. Manager add. Student(Course, Student) Professor name tenor. Status

Classes Scheduling. Algorithm Registration. Form Registration. Manager add. Student(Course, Student) Professor name tenor. Status Course name number. Credits Student open() add. Student(Student) name major Course. Offering number location time open() add. Stduent(Student)

Class Diagram: Relationships

Class Diagram: Relationships

Which of the following is an actual relationship for the system we are modeling?

Which of the following is an actual relationship for the system we are modeling? • Registration. Manager uses Scheduling. Algorithm (dependency) • Registration. Manager uses Student (dependency) • Student uses Registration. Manager (dependency) • Student registers for Course. Offering (association) • Student consists of Course. Offering (aggregation) • Course. Offering is a Course (generalization) • Student is a Registration. User (generalization) • Professor is a Registration. User (generalization)

Which of the following is an actual relationship for the system we are modeling?

Which of the following is an actual relationship for the system we are modeling? • Registration. Manager uses Scheduling. Algorithm (dependency) • Registration. Manager uses Student (dependency) • Student uses Registration. Manager (dependency) • Student registers for Course. Offering (association) • Student consists of Course. Offering (aggregation) • Course. Offering is a Course (generalization) • Student is a Registration. User (generalization) • Professor is a Registration. User (generalization)

Dependency Relationships Scheduling. Algorithm Registration. Manager add. Student(Course, Student) Student name major Registration. Manager

Dependency Relationships Scheduling. Algorithm Registration. Manager add. Student(Course, Student) Student name major Registration. Manager gets a Student object as a parameter. Registration. Manager uses Scheduling. Algorithm in its implementation.

Association Relationships Student name major Re 1. . 50 gis t er sf or

Association Relationships Student name major Re 1. . 50 gis t er sf or 2. . * • The Student registers for a Course. Offering. (see direction adornment. ) • A student can register for two or more course offerings. • Each course offering can enroll between 1 and 50 students. Course. Offering number location time open() add. Stduent(Student)

Aggregation Relationships Course. Offering name number. Credits number location time open() add. Stduent(Student) open()

Aggregation Relationships Course. Offering name number. Credits number location time open() add. Stduent(Student) open() add. Student(Student) • An aggregation is a relationship between two classes in which one represents a larger class. • The diamond, on the side of the whole class indicates, a Course consists of multiple Course. Offerings (has-many).

Generatlization Relationships • Consider a super-class. • Student and Professor are both Registration Users.

Generatlization Relationships • Consider a super-class. • Student and Professor are both Registration Users. Registration. User name Professor Student name tenor. Status name major

Generatlization Relationships • A super-class implies “is-a” relationship Registration. User name Student major Professor

Generatlization Relationships • A super-class implies “is-a” relationship Registration. User name Student major Professor tenor. Status

Class Diagram: Creation Tips • Understand the problem. Make sure that you understand the

Class Diagram: Creation Tips • Understand the problem. Make sure that you understand the domain and that you fully understand what you are supposed to build. • Choose good class names. • Concentrate on the “what”. In the class diagram, we're representing what is in the system. The entities. Do not focus on how things are done. • Start with a simple diagram and refine it. • Build, refine, add, refine, … until the class diagram is complete.