Professional Documents
Culture Documents
Object
Class
Class Relationships
Generalization
Message
Encapsulation
Inheritance
Introduction to OO Concepts
Learning Outcomes
By the end of this lecture, YOU should
be able to :
Demonstrate and apply the key techniques of
analysis and design for the chosen
methodology
Appreciate the use of an analytical framework
for the analysis and design process
Document each stage of analysis and design
to the appropriate standards
CT026-3-1 Systems Analysis and Design
Introduction to OO Concepts
Generalization
Message
Encapsulation
Inheritance
Introduction to OO Concepts
Introduction
OO Analysis
describes information systems by identifying
things called objects
popular approach
end model = object model represents
information systems in terms of objects and
object-oriented concepts
Introduction to OO Concepts
Current issues
Problems faced now:
Systems have grown larger
More complex
Not the only solution
Software crisis is worst today shorter time frame to create softwares
Changed interface
GUI preferred 4GL
CT026-3-1 Systems Analysis and Design
Introduction to OO Concepts
Promises of OO
A new approach
Created to produce software that is more:
Maintainable
Testable
Reusable
Ability to cope with large, complex systems
Introduction to OO Concepts
Conclusion to need of OO
Hence, the requirement for a better
approach was felt: Why?
To reduce development time
Create more robust (tough) systems
Autonomous (independent)systems
Maintainable systems
Testable systems
Introduction to OO Concepts
OO Concepts - Object
Objects
Model real-world objects in application
domain
Entities, objects or things
Forms the subject matter of the system
Eg. In a mail order system, the objects are
customers, orders, products
Eg. In a library system, the objects are members,
books, loans, reservations
Eg. In a restourant system, the objects are
customers, tables, reservations, cancellations
CT026-3-1 Systems Analysis and Design
Introduction to OO Concepts
OO Concepts - Object
Objects are features of the problem domain.
Types of objects:
a. Physical things- customers, products, members,
books
b. Conceptual things orders, loans, reservations,
cancellations
c. Organisational things companies, departments
d. Computer implementation features eg: GUI
Introduction to OO Concepts
car
OO Concepts - Object
Object
computer representation of real-world thing /
event
described by its:
Attributes characteristics that describe object
Methods tasks / functions
Introduction to OO Concepts
OO Concepts - Object
In UML, an object diagram is as shown
below: a software object
Jemina: Car
Fuel: 6.4 litres
Speed: 32kph
Temperature:
cool
Introduction to OO Concepts
OO Concepts - Class
Class-Defines an object
Specify the attributes and operations for
each instance of an object
Instance means a record.
A class shows a general representation
(variables and operations) of the object
diagram, not an instance.
Introduction to OO Concepts
Object-oriented concepts
Class
category of similar objects
template for all objects of that class
Introduction to OO Concepts
OO Concepts - Class
Eg. Of a representation of a class diagram
in UML
Car
fuel
speed
temperature
stop()
start()
reverse()
move()
CT026-3-1 Systems Analysis and Design
Introduction to OO Concepts
OO Concepts - Class
association -- a relationship between instances
of the two classes. In a diagram, an association
is a link connecting two classes.
aggregation -- an association in which one class
belongs to a collection. An aggregation has a
diamond end pointing to the part containing the
whole.
Introduction to OO Concepts
OO Concepts - Class
generalization -- an inheritance link indicating one class
is a superclass of the other. A generalization has a
triangle pointing to the superclass.
An association has two ends. An end may have a role
name to clarify the nature of the association.
A navigability arrow on an association shows which
direction the association can be traversed or queried.
Introduction to OO Concepts
OO Concepts - Class
multiplicity of an association end is the number of
possible instances of the class associated with a single
instance of the other end. Multiplicities are single
numbers or ranges of numbers.
Multiplicities
Meaning
0 ... 1
n ... m
0 ... * or *
1
1 ... *
Introduction to OO Concepts
OO Concepts - Attribute
It is the data items that defines a class.
Eg. name, address, telno, gender for the
class customer.
Each instance of the object has the same
number of attributes, but each instance
may have different values, eg: each
customer can have a different name.
Introduction to OO Concepts
OO Concepts - Operation
Introduction to OO Concepts
OO Concepts - Method
Refers to procedures that form part of a
class structure
Executed when a request is received
Operations are called methods during
code implementation, i.e. the code that is
executed during a request.
Introduction to OO Concepts
OO Concepts - Message
Objects interacting with one another requesting
for particular services.
It involves:
client / sender initiating object, makes/initiates request
server / receiver receiving object, executes request
Introduction to OO Concepts
Object-oriented concepts
Introduction to OO Concepts
OO concepts- Encapsulation
Encapsulation
packaging data and operations into an object
provides three software desirable software
properties:
Purpose:
Proper Modularity- Models real-world objects ,
easy to understand
Data Abstraction- Clients only need to know
information provided by the public interface
Data Hiding- Data encapsulated within an object
and only be accessed by that objects operations
CT026-3-1 Systems Analysis and Design
Introduction to OO Concepts
Object-oriented concepts
Inheritance
a mechanism which allows new classes to be
defined in terms of existing classes
new class inherits / includes the features
(operations and attributes) of the class it is
created from
Introduction to OO Concepts
OO Concepts - Inheritance
The child class:
Introduction to OO Concepts
OO Concepts - Inheritance
Inheritance
Introduction to OO Concepts
Object-oriented concepts
Polymorphism
the ability to define program entities that take
more than one form
allows a single message to be interpreted
differently by different objects
Introduction to OO Concepts
Object-oriented concepts
Polymorphism
Introduction to OO Concepts
Follow-up Assignment
Briefly explain the difference the following pairs
of object-oriented terms. You should include
small examples to illustrate your answers:
class / object
attribute / operation
association / multiplicity
subclass / superclass
message / method
encapsulation / data hiding
Introduction to OO Concepts
Introduction to OO Concepts
Q&A
CT026-3-1 Systems Analysis and Design
Introduction to OO Concepts
Next Session
Introduction to UML Diagrams
Use Case Diagram
Sequence Diagram
Class Diagram
Introduction to OO Concepts