Introduction OOSAD (2019)
Introduction OOSAD (2019)
Introduction OOSAD (2019)
Actual curve
failure rate failure rate change
Idealized curve
time time
Hardware Software
What are the attributes of good
Software?
The software should deliver the required
functionality and performance to the user and
should be maintainable, dependable, efficient
and usable.
Maintainability
Software must (easily) evolvable to meet
changing needs
Dependability
Software must be trustworthy (work with all
data)
Efficiency
Software should not make wasteful use of
system resources
Usability
Software must be usable by the users for which it
was designed
Where isSoftware?
In computer systems
Operating systems (eg: Windows, Linux)
End-user programs (eg:Photoshop, dreamveawer)
Compilers (eg: javac, pascal, gcc)
Aircrafts, Space Shuttles (Eg: F16, Discovery Space Shuttle )
Cellular Phones (Eg: IOS, Android
etc.)
Education (Eg: Distance Learning)
Entertainment, Transportation
Health systems, Military
And many more….
Object-Oriented Analysis and
Design
• Works well in situations where
complicated systems are undergoing
continuous maintenance, adaptation,
and design
• Objects, classes are reusable
• The Unified Modeling Language (UML)
is an industry standard for modeling
object-oriented systems.
10-10
Object-Oriented Analysis and
Design (continued)
• Reusability
• Recycling of program parts should reduce
the costs of development in computer-
based systems
• Maintaining systems
• Making a change in one object has a
minimal impact on other objects
10-11
Major Topics
• Object-oriented concepts
• CRC cards and object think
• Unified Modeling Language
• Use case and other UML diagrams
• Packages
• Using UML
10-12
Object-Oriented Concepts
• Objects
• Classes
• Inheritance
10-13
Objects
10-14
Classes
10-15
An Example of a UML Class: A Class Is Depicted as a
Rectangle Consisting of the Class Name, Attributes, and
Methods (Figure 10.1)
10-16
Inheritance
10-17
A Class Diagram Showing Inheritance (Figure 10.2)
10-18
CRC Cards and Object Think
• CRC
• Class
• Responsibilities
• Collaborators
• CRC cards are used to represent the
responsibilities of classes and the
interaction between the classes
10-19
Four CRC Cards for Course Offerings Show How Analysts Fill in the
Details for Classes, Responsibilities, and Collaborators, as Well as for
Object Think Statements and Property Names (Figure 10.3)
10-20
Interacting during a CRC Session
10-21
The Unified Modeling Language
(UML) Concepts and Diagrams
• Things
• Relationships
• Diagrams
10-22
Things
10-23
Relationships
• Structural relationships
• Tie things together in structural diagrams
• Behavioral relationships
• Used in behavioral diagrams
10-24
Structural Relationships
• Dependencies
• Aggregations
• Associations
• Generalizations
10-25
Behavioral Relationships
• Communicates
• Includes
• Extends
• Generalizes
10-26
Diagrams
• Structural diagrams
• Used to describe the relation between
classes
• Behavior diagrams
• Used to describe the interaction between
people (actors) and a use case (how the
actors use the system)
10-27
Structural Diagrams
• Class diagrams
• Object diagrams
• Component diagrams
• Deployment diagrams
10-28
Behavioral Diagrams
10-29
An Overall View of UML and Its Components: Things,
Relationships, and Diagrams (Figure 10.4)
10-30
Commonly Used UML Diagrams
10-31
Commonly Used UML Diagrams
(continued)
• Sequence diagrams
• Show the sequence of activities and class
relationships
• Class diagrams
• Show classes and relationships
• Statechart diagrams
• Show the state transitions
10-32
An Overview of UML Diagrams Showing How Each
Diagram Leads to the Development of Other UML
Diagrams (Figure 10.5)
10-33
Use Case Modeling
10-34
A Use Case Example of Student
Enrollment (Figure 10.6)
10-35
A Use Case Scenario Is Divided into Three Sections:
Identification and Initiation, Steps Performed, and
Conditions, Assumptions, and Questions (Figure 10.7)
10-36
Activity Diagrams
10-37
Specialized Symbols Are Used to Draw an
Activity Diagram (Figure 10.8)
10-38
Creating Activity Diagrams
10-39
Swimlanes
10-40
This Activity Diagram Shows Three Swimlanes: Client
Web Page, Web Server, and Mainframe (Figure 10.9)
10-41
Activity Diagrams and Test Plans
10-42
Activity Diagrams Not Created for
All Use Cases
• Use an activity diagram when:
• It helps to understand the activities of a
use case
• The flow of control is complex
• There is a need to model workflow
• When all scenarios for a use case need to
be shown
10-43
Sequence Diagrams
10-44
Specialized Symbols Used to Draw a
Sequence Diagram (Figure 10.10)
10-45
A Sequence Diagram for Student Admission: Sequence
Diagrams Emphasize the Time Ordering of Messages
(Figure 10.11)
10-46
Communication Diagrams
10-47
A Communication Diagram for Student
Admission (Figure 10.12)
10-48
Class Diagrams
10-49
Class Diagrams (continued)
• Classes
• Attributes
• Private
• Public
• Protected
• Methods
• Standard
• Custom
10-50
A Class Diagram for Course Offerings: The Filled-In
Diamonds Show Aggregation and the Empty Diamond
Shows a Whole-Part Relationship (Figure 10.13)
10-51
Method Overloading
10-52
Types of Classes
• Entity classes
• Interface classes
• Abstract classes
• Control classes
10-53
Entity Classes
10-54
Interface or Boundary Classes
10-55
Abstract Classes
10-56
Control Classes
10-57
Presentation, Business, and
Persistence Layers
• Sequence diagrams may be discussed using
three layers:
• Presentation layer, what the user sees,
corresponding to the interface or boundary classes
• Business layer, containing the unique rules for this
application, corresponding roughly to control
classes
• Persistence or data access layer, for obtaining and
storing data, corresponding to the entity classes
10-58
Defining Messages and Methods
10-59
A Sequence Diagram for Using Two Web Pages: One for
Student Information, One for Course Information
(Figure 10.15 )
10-60
Create Sequence Diagrams
10-61
Creating a Test Plan from a
Sequence Diagram
• Does each method return correct results?
• Ensure that entity classes store or obtain the
correct attribute values
• Verify that all JavaScript paths work correctly
• Ensure that the server control classes work
correctly
• Ask, “What may fail?”
• Determine what to do if something can fail
10-62
Relationships
10-63
An Example of an Associative Class in Which a Particular
Section Defines the Relationship between a Student and
a Course (Figure 10.18)
10-64
Associations
10-65
Whole/Part Relationships
10-66
Aggregation
• A “has a” relationship
• Provides a means of showing that the
whole object is composed of the sum of
its parts
10-67
Collection
10-68
Composition
10-69
An Example of Whole-Part and
Aggregation Relationships (Figure 10.19)
10-70
Generalization/Specialization
Diagrams
• Generalization
• Inheritance
• Polymorphism
• Abstract classes
• Messages
10-71
Generalization
10-72
Inheritance
10-73
Polymorphism
10-74
Abstract Classes
10-75
A Generalization/Specification Diagram
Is a Refined Form of a Class Diagram
(Figure 10.20)
10-76
Finding Classes
10-77
Determining Class Methods
• Standard methods
• Examine a CRUD matrix
10-78
Messages
10-79
Statechart Diagrams
10-80
Statechart Diagrams
(continued)
• Created when:
• A class has a complex life cycle
• An instance of a class may update its
attributes in a number of ways through the
life cycle
• A class has an operational life cycle
• Two classes depend on each other
• The object’s current behavior depends on
what happened previously
10-81
A Statechart Diagram Showing How a Student
Progresses from a Potential Student to a Graduated
Student (Figure 10.22)
10-82
Packages
10-83
Use Cases Can Be Grouped into
Packages (Figure 10.23)
10-84
Putting UML to Work
10-85
Summary
• Object-oriented systems
• Objects
• Classes
• Inheritance
• CRC cards
• UML and use case modeling
• Components of UML
• Things
• Relationships
• Diagrams
10-86
Summary (continued)
• UML diagrams
• Use case diagrams
• Activity diagrams
• Sequence diagrams
• Communication diagrams
• Class diagrams
• Statechart diagrams
• Using UML
10-87