Unit 1 Notes - OOAD
Unit 1 Notes - OOAD
• analyzing,
Faster development,
Reusability,
Increased quality
modeling the real world and provides us with the stronger equivalence of the
real world‘s entities (objects).
• Changing requirements
• Easier to maintain
• More robust
• Code reuse
OBJECT BASICS
Goals:
A window object is responsible for things like opening, sizing, and closing
itself.
A chart object is responsible for things like maintaining data and labels even
for drawing itself.
OBJECT BASICS
EXAMPLES OF OBJECT ORIENTED SYSTEMS
A window object is responsible for things like opening, sizing, and closing
itself.
A chart object is responsible for things like maintaining data and labels even
for drawing itself.
OBJECT BASICS
WHAT IS AN OBJECT?
The role of a class is to define the attributes and methods (the state and
behaviour) of its instances.
The class car, for example, defines the property color. Each individual car
(object) will have a value for this property, such as "maroon," "yellow" or
"white."
OBJECT BASICS
Polymorphism
Polymorphism is the ability of an object to take on many forms.
public int mulNum (int x, int y) {
//
}
public int mulNum (double x, double y) {
//
}
OBJECT BASICS
Inheritance
Classes can share, obtain or “inherit” properties and methods that belong to existing classes.
public class Flower {
String name;
String color;
void pollination() {
}
}
public class Rose extends Flower {
}
OBJECT BASICS
Data Abstraction
}
OBJECT BASICS
Encapsulation
• Encapsulation refers to keeping objects with their methods in one place.
public class Employeedetails {
private String employeeName;
private String employeeDept;
private int salary;
public void work () {
}
public void train () {
}
}
Unified Process
Unified Process (UP)
• The Unified Process is a popular iterative software development process for
building object oriented system.
• It typically also means that development starts before the exact software
requirements have been specified in detail;
• Elaboration
• Construction
• Transition
FOUR PHASES OF UNIFIED PROCESS
• Inception
Approximate vision, business case, scope, vague estimates.
• Elaboration
Refined vision, iterative implementation of the core architecture, resolution of high
risks, identification of most requirements and scope, more realistic estimates.
• Construction
Iterative implementation of the remaining lower risk and easier elements, and
preparation for deployment.
• Transition
Beta tests, deployment.
UP PHASES DIAGRAM
UP Disciplines
• Several disciplines in the UP
Implementation means programming and building the system, not deploying it.
❖ Feasibility
❖ Buy or Develop it
Inception - Activities
• Formulate the scope of the project.
Needs of every stakeholder, scope, boundary conditions and acceptance criteria
established.
• Plan and prepare the business case.
Define risk mitigation strategy, develop an initial project plan and identify
known cost, schedule, and profitability trade-offs.
• Synthesize candidate architecture.
Candidate architecture is picked from various potential architectures
• Prepare the project environment.
Inception - Exit criteria
• An initial business case containing at least a clear formulation of the product
vision - the core requirements - in terms of functionality, scope, performance,
capacity, technology base.
• The plan approved by the project management, and funding authority, and the
resources required for the elaboration phase have been allocated.
Elaboration - Activities
• Define the architecture.
Project plan is defined. The process, infrastructure and development
environment are described.
• A baseline vision, in the form of a set of evaluation criteria for the final product
• The product and artifacts of the previous iteration. The iteration plan must
state the iteration specific goals
• Objective measurable evaluation criteria for assessing the results of the next
iterations.
Transition - Entry criteria
• The product and artifacts of the previous iteration, and in particular, a software
product sufficiently mature to be put into the hands of its users.
Transition - Activities
➢The standard is created and managed by, the Object Management Group.
systems.
GOALS OF UML
➢To provide ready to use and expensive visual modeling language for
developing the effective system model.
✓ class diagram
✓ Interaction diagram
✓sequence diagram
✓Collaboration diagram
✓ Activity diagram
✓ Component diagram
✓ Deployment diagram
CASE STUDY – THE NEXTGEN POS SYSTEM
➢ The NextGen point-of-sale (POS) system
➢ What is Inception?
➢ Inception: An Analogy
➢ Understanding Requirements
➢ Types of Requirements
INCEPTION
➢ Introduction
➢ Inception is the initial short step to establish a common vision and basic
scope of the project.
➢ It will include
❖ Analysis of 10% use cases.
❖ Feasible?
❖ Determine if it is feasible.
➢ Packaging
➢ Use cases are a widely used mechanism to discover and record requirements.
➢ We will discuss
➢ how to write use cases and draw a UML use case diagram.
➢ To capture these goals and system requirements - customers and end users—
to contribute to their definition or evaluation.
Example
Process Sale:
A customer arrives at a checkout with items to purchase. The
cashier uses the POS system to record each purchased item. The
system presents a running total and line-item details. The
customer enters payment information, which the system
validates and records. The system updates inventory. The
customer receives a receipt from the system and then leaves with
the items.
Definitions : What are Actors, Scenarios, and
Usecases?
➢ Actor :
➢ Scenario :
➢ use case
❖ UML defines a use case diagram to illustrate the names of use cases and
actors, and their relationships.
WHY USE CASES
❖ Simple
❖ Familiar
❖ Use cases are requirements (although not all requirements). Some think of
requirements only as "the system shall do..."
Actors
❖ An actor is anything with behavior, including the system under discussion
(SuD) itself when it calls upon the services of other systems.
❖ Actors are not only roles played by people, but organizations, software, and
machines.
❖ Primary actor
❖ Supporting actor
❖ Offstage actor
Actors
❖Primary actor
❖ Supporting actor
❖ Offstage actor
- has an interest in the behavior of the use case, but is not primary or supporting
how it will do it
Black-box style Not
Example
The system writes the sale to a database.
The system records the ...or (even worse):
sale. The system generates a SQL INSERT
statement for the sale...
Use Case Types and Formats
❖ Use cases are written in different formats, depending on need.
❖ Brief
❖ casual
❖ fully dressed
- the most elaborate. All steps and variations are written in detail, and there are supporting
sections, such as preconditions and success guarantees.
Fully Dressed Example
The Two-Column Variation
❖ Some prefer the two-column or conversational format, which emphasizes the
fact that there is an interaction going on between the actors and the system.
Finding Primary Actors,
Goals, and Use Cases
Finding Primary Actors, Goals, and Use Cases
❖ Use cases are defined to satisfy the user goals of the primary actors.
- Example - For this case study, the POS system itself is the system under
design.
- Once the external actors are identified, the boundary becomes clearer.
Finding Primary Actors, Goals, and Use Cases
❖ Steps 2 and 3: Finding Primary Actors and Goals
- To find primary actors and goals then set up the framework for further investigation
- primary actors and user goals, the following questions help identify others.
Who starts and stops the system? Who does user and security management?
Is there a monitoring process that restarts the system if it fails? How are software updates handled?
Is "time" an actor because the system does something in response to a time event?
Who evaluates system activity or performance? Who evaluates logs? Are they remotely retrieved?
Finding Primary Actors, Goals, and Use Cases
- (2) Primary and Supporting Actors
- primary actors have user goals fulfilled through using services of the
system.
- Why is the cashier, and not the customer, the primary actor in the use
case Process Sale?
Finding Primary Actors, Goals, and Use Cases
❖Step 4: Define Use Cases
❑ Name the use case similar to the user goal and Also, name use cases starting
with a verb.
❖ Your boss asks, "What have you been doing all day?"
❖ A use case typically contains many steps, and in the fully dressed format will
often require 310 pages of text.
❖ Use case diagrams model the functionality of a system using actors and use
cases.
❖ Use case diagrams model the functionality of a system using actors and use
cases.
❖Problem Statement
- Customer
- Bank
- ATM Technician
- ATM Operator
Example ATM Machine
❖ Define Use cases
- Check Balances
- Deposit Funds
- Withdraw Cash
- Transfer Funds
- Maintenance
- Repair
- Refill
Example ATM Machine
❖ UC1 - Check Balances
Extension
❖ For example, a sub function use case such as Handle Credit Payment may
be part of several regular use cases, such as Process Sale and Process Rental.
❖ Include
❖ Exclude
❖ Generalization
Relating Use cases – Include Relationship
❖ This is the most common and important relationship.
❖ When even the base use case happen then sub use case is also must happen.
<<include>>
Base Use case Sub Use case
Relating Use cases – Include Relationship
❖For example: UC1:
Process Sale
Main Success Scenario:
1 . Customer arrives at a POS checkout with goods and/or services to purchase.
7. Customer pays and System handles payment.
Extensions:
7b. Paying by credit: Include Handle Credit Payment. 7c. Paying by check:
Include Handle Check Pavment.
Relating Use cases – Include Relationship
❖For example: UC7: Process Rental
Extensions:
6b. Paying by credit: Include Handle Credit Payment
Handle cash
payment
Relating Use cases – Include Relationship
❖ Summary
❖ Extension points are labels in the base use case which the extending use case
references as the point of extension
Relating Use cases – Extend Relationship
<<extend>>
Base Use case Sub Use case
Relating Use cases – Extend Relationship
Relating Use cases
Sneeze
<<extend>>
Say Excuse me
Relating Use cases – Generalization
❖ Generalization is the activity of identifying commonality among concepts
and defining super class (general concept) and subclass (specialized concept)
relationships.
Define and Explain UPM with its phase for developing the above online
baking company.
Ordering food in a restaurant
Identify Actors.
Ordering food in a restaurant
Identify Use case.
Ordering food in a restaurant
Write use case modelling choose any use case write fully dressed format
❖UC1 -
Scope –
Level –
Primary Actor –
Precondition
Success Guarantee –
Extension
Ordering food in a restaurant
Draw Use case Diagram
Previous Year University Questions
2. Develop a use case model for activities involved in ordering food in a
restaurant from the point when the customer enters a restaurant to the point
when leave the restaurant.
Ordering food in a restaurant
Identify Actors.
Ordering food in a restaurant
Identify Use case.
Ordering food in a restaurant
Write use case modelling choose any use case write fully dressed format
❖UC1 -
Scope –
Level –
Primary Actor –
Precondition
Success Guarantee –
Extension
Ordering food in a restaurant
Draw Use case Diagram