ENTD 278 AMU WK 2 IT Online Training on Information Technology Essay
The purpose of this assignment is to continue building our ITOT case study models by using the classes and their properties from Assignment 1 and creating a class diagram and Class and Relationship Analysis table for the relationships among classes. In addition, we will build a state diagram for the ShoppingCart class.
Course Objective(s):
CO1: Explain advanced class modeling concepts and the state model
CO9: Apply your knowledge of object oriented and UML concepts by designing and developing UML models
Assignment Instructions
In this assignment you will create a class diagram using the Class and Relationship Analysis table for all of the classes you identified in Assignment 1 and a state diagram for your ShoppingCart class. Make certain that you include all of the classes and any additional classes or corrections to your Assignment 1.
For the Analysis Specification you will add the following completed sections:
Sections 4, 4.1, 4.2 (adjustments if necessary), 4.3, 4.3.1, 4.4., 5, 5.1, 5.2
Directions
1. Read and review the Quick Resources at the end of this Assignment.
2. Class Diagram. Create a UML class diagram with attributes, associations, multiplicity constraints, and operations using your CASE tool. Add your name and course number directly on your diagram. You must use the CASE tool to create your UML models!
The following sections apply to creating a class diagram and provides examples. Read through them (2.1 - 2.3) before you start.
2.1 Section 4.3 Lists of Classes with Definitions, Attributes, and Operations. Update your list of classes , attributes, operations, and requirements with any classes you omitted from the following list: Account, Administrator, CourseAdministrator, Book, Certificate, Course, CourseHistory, CourseSchedule, CreditCard, Customer, Instructor, Order, Payment, Product, ScheduleAdministrator, ScheduledCourse, SelfPacedCourse, ShoppingCart, ShoppingCartItem, User (username, password, status), Video, etc.
2.2 Class Diagram. Section 4.1. Use your CASE tool to create a UML class diagram that includes the following classes: Customer, Account, ShoppingCart, ShoppingCartItem, Product, Video, Book, Course, Payment, and Order. Each class must have attributes, operations, and relationships to other classes. It is helpful to do a rough sketch of the diagram on paper before you create your diagram in the CASE tool. Note that Product forms a generalization hierarchy with Video, Book, and Course. You will also want to use a composition relationship in your diagram from Customer to Account, from Order to Account, and from Account to ShoppingCart . You will need to add other relationships. You will benefit from viewing the example online shopping domain UML diagram listed in the next paragraph.
2.2.1 Attributes. Add attributes for each class and relationships between classes. Attributes are properties of classes, have names, and also have data types indicating the type of data expected like text, numbers, etc.. For example, a name attribute would be text type data. Relationships establish some linkage between classes and can include associations, generalization, aggregation, and composition . Associations are the most common relationships and are named with verb phrases. See the example class diagram for our case study in Sample UML Class Diagrams for ITOT Classes and access the link here for an example of a ShoppingCart class diagram similar to our model.
2.2.2 Operations. You will also need to add operations for each of your classes. A class may have its own special operations. For example a Circle class will have draw() operation. So your classes will also have their own special operations. There are also general categories of operations like the CRUD (Create Read Update Delete) operations that apply to classes and their attributes. You will want to Create() and instance of a class, read (get) the values of its attributes, update (set) the values of a class's attributes as well. We won't worry about Delete at this point in our analysis--this occurs in design. You CASE tool will help here. As you add a class using the CASE tool, if you right click on the class and choose the option to" Add attributes with getter and setter methods". Your CASE tool will automatically add getter/setter as methods for each attribute. This saves considerable time and effort. Getter/get operations are similar to read and produce values of attributes. Setter/set operations change values of attributes.
2.2.3 Relationships. Class Diagram. Section 4.1. Include at least 9 named relationships with multiplicity constraints on associations to other classes. Names and multiplicity constraints are required on all associations. The shape of the line used indicates the type of relationship for generalization, aggregation, and composition relationships so you do not need names here. Association names are often verb phrases like "purchases" from "A Customer purchases a ScheduledCourse". To determine the associations, you can also use the same technique as the noun analysis, but do verb analysis instead. Review Section 2.2 above for some pointers on relationships. To help you discover the associations and multiplicity constraints, complete the Class and Relationship Analysis table below and add it to Section 4.2 . The class and Relationship Analysis table is already included in Section 4.2 of your specification.
Identify the relationships among the classes. Associations are bidirectional and so we must consider them in both directions with multiplicity constraints as well. Using a table for the initial analysis will make it easier to create a class diagram. For each class ask the question "What other classes is the class related to?" or "What is the relationship between these two classes?" Once you identify the classes, then for each class pair ask "What is the relationship?" Multiplicity constraints are needed on both ends of the association and may be zero or one (0..1), one and only (1), zero or more (0..*), or many (*) ,etc. As you can see below there are two sentences with the multiplicity constraints describing the association in both directions. In this example the two classes are Instructor and Course. The relationship is "teaches". On our diagrams we usually only show the relationship name in one direction and mentally reverse the verb phrase in the other direction. See Figures 3.12 and 3.15 in your textbook for an example of a class diagram with named associations and multiplicity constraints.
Class and Relationship Analysis
Class Name 1
Relationship with Multiplicity
Class Name 2
Instructor
An Instructor teaches zero or more (0..*) Course
A Course is taught by a single (1) Instructor
Course
2.2.3.1 Section 4.1. Add multiplicity constraints that you identified in the Class and Relationship Analysis table to each end of a relationship between classes. UML multiplicity constraints include the pairs 1..1, 1..*, *..*, 0..1, as well as others.
2.3 Section 4.1 Place your completed class diagram in Section 4.1.
2.4 Section 4.1. Make certain that you continue from your Assignment 1 submission. Each week we will add to the Analysis Specification document until we finally complete it. So just take your previous assignment and add this assignment to it.
2.5 Section 4. Complete Section 4 of the Analysis Specification with a brief introduction to the contents of the section. You can now include this since you have completed your class diagram.
2.6 Sections 4.1, 4.2 and 4.3. These sections should be consistent. Make any necessary adjustments from Assignment 1 and the list of classes provided above. Update your discussion in Section 4.3.1 to reflect the new classes.
2.7 Section 4.4. Complete Section 4.4 of the Analysis Specification with a discussion of your class diagram.
3. Create a UML state diagram for the ShoppingCart class with your CASE tool. Add your name and course number directly on your diagram. Make certain that you name the transitions and add guards as necessary. States are named using gerunds (ing verb form), past participle, prepositional phrases, or attributes. A state diagram is not an activity diagram! For example for a pizza you might order online the states might be building, assembling,baking, quality checking, delivering, delivered
3.1 Sections 5.1 and 5.2. Add your UML state diagram along with a discussion to Sections 5.1 and 5.2 of your Analysis Specification. See the article, ENTD321 Week 2 State How to Create a State Diagram.pdf, below on creating a state transition diagram before you start your diagram.