UNIT 1 UNIFIED PROCESS AND USE CASE DIAGRAMS 0/0
Introduction to OOAD with OO Basics – Unified Process – UML diagrams – Use Case –Case study – the Next Gen POS system, Inception -Use case Modelling – Relating Use cases – include, extend and generalization – When to use Use-cases
UNIT II STATIC UML DIAGRAMS 0/1
Class Diagram–– Elaboration – Domain Model – Finding conceptual classes and description classes – Associations – Attributes – Domain model refinement – Finding conceptual class Hierarchies – Aggregation and Composition – Relationship between sequence diagrams and use cases – When to use Class Diagrams
UNIT III DYNAMIC AND IMPLEMENTATION UML DIAGRAMS 0/1
Dynamic Diagrams – UML interaction diagrams – System sequence diagram – Collaboration diagram – When to use Communication Diagrams – State machine diagram and Modelling –When to use State Diagrams – Activity diagram – When to use activity diagrams Implementation Diagrams – UML package diagram – When to use package diagrams – Component and Deployment Diagrams – When to use Component and Deployment diagrams
UNIT IV DESIGN PATTERNS 0/1
GRASP: Designing objects with responsibilities – Creator – Information expert – Low Coupling – High Cohesion – Controller Design Patterns – creational – factory method – structural – Bridge – Adapter – behavioural – Strategy – observer –Applying GoF design patterns – Mapping design to code
UNIT V TESTING 0/1
Object Oriented Methodologies – Software Quality Assurance – Impact of object orientation on Testing – Develop Test Cases and Test Plans
Class Diagram in OOAD
Class Diagram gives the static view of an application. A class diagram describes the types of objects in the system and the different types of relationships that exist among them. This modeling method can run with almost all Object-Oriented Methods. A class can refer to another class. A class can have its objects or may inherit from other classes.
Class diagram shows a collection of
- and constraints.
It is also known as a structural diagram.
Class diagrams are the main building block in object-oriented modeling. They are used to show the different objects in a system, their attributes, their operations and the relationships among them.
The following figure is an example of a simple class:
In the example, a class called “loan account” is depicted. Classes in class diagrams are represented by boxes that are partitioned into three:
- The top partition contains the name of the class.
- The middle part contains the class’s attributes.
- The bottom partition shows the possible operations that are associated with the class.
Basic Class Diagram Symbols and Notations
A class represents a relevant concept from the domain, a set of persons, objects, or ideas that are depicted in the IT system:
Examples of classes are passengers, planes, or tickets.
An attribute of a class represents a characteristic of a class that is of interest for the user of the IT system:
Characteristics of interest of a passenger, for example, are name and age.
Generalization is a relationship between two classes: a general class and a special class:
An association represents a relationship between two classes:
An association indicates that objects of one class have a relationship with objects of another class, in which this connection has a specifically defined meaning (for example, “is flown with”).
A multiplicity allows for statements about the number of objects that are involved in an association:
Also see Figure 4.32.
An aggregation is a special case of an association (see above) meaning “consists of”:
The diamond documents this meaning; a caption is unnecessary.
Purpose of Class Diagrams
The purpose of class diagram is to model the static view of an application. Class diagrams are the only diagrams which can be directly mapped with object-oriented languages and thus widely used at the time of construction.
The purpose of the class diagram can be summarized as −
- Analysis and design of the static view of an application.
- Describe responsibilities of a system.
- Base for component and deployment diagrams.
- Forward and reverse engineering.
Benefits of Class Diagram
- Class Diagram Illustrates data models for even very complex information systems
- It provides an overview of how the application is structured before studying the actual code. This can easily reduce the maintenance time
- It helps for better understanding of general schematics of an application.
- Allows drawing detailed charts which highlights code required to be programmed
- Helpful for developers and other stakeholders.
Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application. A collection of class diagrams represent the whole system.
The following points should be remembered while drawing a class diagram −
- The name of the class diagram should be meaningful to describe the aspect of the system.
- Each element and their relationships should be identified in advance.
- Responsibility (attributes and methods) of each class should be clearly identified
- For each class, minimum number of properties should be specified, as unnecessary properties will make the diagram complicated.
- Use notes whenever required to describe some aspect of the diagram. At the end of the drawing it should be understandable to the developer/coder.
- Finally, before making the final version, the diagram should be drawn on plain paper and reworked as many times as possible to make it correct.
The following diagram is an example of an Order System of an application. It describes a particular aspect of the entire application.
- First of all, Order and Customer are identified as the two elements of the system. They have a one-to-many relationship because a customer can have multiple orders.
- Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder and NormalOrder.
- The two inherited classes have all the properties as the Order class. In addition, they have additional functions like dispatch () and receive ().
The following class diagram has been drawn considering all the points mentioned above.
Class diagram examples
Online Shopping Cart class diagram
Pattern Adapter class diagram