Chapter One Object Orientation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Chapter One-Par t II

Object-oriented System Development


Methodolog y

1
Brain storming questions
What does it mean:
oobject?
oclasses?
oObject-oriented?
Why Object-orientation?
2
Two Orthogonal Software

• There are two approach in related to view of


software.
o Traditional approach
o Object oriented methodology

3
Traditional Approach:
It is:
o Collection of procedures(functions)
o Focuses on functions and procedures
o Different styles and methodologies for each steps of process.
o Moving from one phase to another is phase complex.
o Increasing duration of project
o Increase complexity.

4
Object Oriented methodology:
It is:
o Combination of data and functionality.
o Focuses in object, classes, modules that can be easily replaced,
modified, and reused.
o Decrease duration of the project.
o Moving one phase to another is easy.
o Reduces complexity and redundancy.

5
Object-Oriented System Development Methodology

• Develops software by building objects.

• Objects can be easily replaced, modified and reused.

• Each object has attributes (data) and methods


(functions).

• Software is a collection of discrete objects that


encapsulate their data and function.

6
Why Object-Orientation?
Because :

o Easier to adapt changing requirements,

o Easier to maintain,

o More robust,

o Promote greater design and code reuse.

o Create modules of functionality

7
What is Object?

An object is:
• A thing
• An entity
• Something can pick up or kick
• Anything that can be imagine that has its own identity.

Objects in the real world


Examples:

 A car  A house  A dog  A check book or


 A person  A table  A pot plant  A raincoat.

8
• Objects have their own independence
existence.
• Each object has their own identity.
• Object is depict by the standard
notation of object.
• Equal objects are not identical.

Standard notation object A coffee machine object

9
Basic Concepts of Object

• Objects are grouped in Classes


• Attributes
• Objects respond to Messages
• Object behaviour and Methods
• Encapsulation and Information Binding
• Class Hierarchy
• Inheritance

• Polymorphism
• Object Relationships
• Aggregation and Object Containment

10
Class:
Vehicle
• Class is a set of objects.
• Class has common structure and behaviour. landVehicle
waterVehicle
• Object is single instances of a class. airVehicle
Exercise: Group the following objects in one of Truck Bus
Automobile
these classes Air Vehicle, Land Vehicle or Water Ship
Boat
Vehicle. Plane Helicopter

o Ship, Boat, Truck , Bus, Automobile, plane,


Helicopter
Attributes: Engine
Example: +capacity
• Attributes are state and properties of the object. +horsePower
• Properties represent the state of an object. +manufacturer: String
+numberOfCylinders
Exercise: Assign the attributes for objects in Land +fuelInjection: boolean
Vehicle classes

11
Behaviour:
• It denotes the collection of methods that abstractly describes where an object is
capable of doing.
• A collective term for all of an object’s operations.
Methods:
• It encapsulate the behaviour of the object.
• It provide interfaces to an object and hide any of the internal structures and states
maintained by the object.
Message
• It is the instruction and method is the implementation.
• An object understands a message when it can match message to a method that has
same name as of it.
• Objects interact with each other by sending and receiving messages.
• Objects perform operations in response to messages

12
Information Hiding:
• It is the principle of concealing the internal data and procedures of an object.
• Providing an interface to each object in such a way as to reveal as little as
possible about its inner workings.
Encapsulation:
• An object is said to encapsulate the data and a program
• Encapsulation or information hiding is a design goal of an OO system.
Class Hierarchy:
• System made up of interrelated components.
• At the top of the class hierarchy are the most general classes
• At the bottom class hierarchy are the most specific classes .
• A subclass inherits all of the properties and methods defined in its super class.

13
Example:
• The vehicle class is the super class.
• Air Vehicle, Land Vehicle, and Water
Vehicle are the sub class of the class
vehicle.
• Two types of hierarchy: IS–A” hierarchy
o IS–A” hierarchy:
o Part-of Hierarchy

Part-of Hierarchy

14
Polymorphism:
• It means that the same operation may behave differently on different
classes.
Relationships: Polymorphism
• It's the relationships among classes that provide the foundation for the
structure of a new system
• Association represents the relationships between objects and classes.
• Associations are bidirectional with different annotations.
Aggregation:
Association
• As each object has an identity.
• One object can refer to other objects.
• This is known as aggregation.
Composition:
Composition
• Strong aggregation.
• A relationship where the part can exist independently of the whole. Aggregation
15
Inheritance:
• Objects to be built from other objects.
• Object will take commonality of a new class.
• Three types of inheritance: Single, Dynamic, and
Multiple inheritance.
• Single inheritance: an object built from a single object.
• Multiple Inheritances: an object built from two or
more object.
• Dynamic inheritance: allows objects to change and
evolve over time.

16
Unified Approach
• UA establishes a unifying and unitary framework works by

o Unified Modelling Language (UML) to describe model, and

o Document the software development process.

• The idea behind the UA is not to introduce yet another methodology.

• The main motivation here is to combine

o The best practices, processes, methodologies, and guidelines along with

o UML notations and diagrams.

17
• The unified approach to software development revolves around (but is
not limited to) the following processes and concepts.

o Use-case driven development

o Object-oriented analysis

o Object-oriented design

o Incremental development and prototyping

o Continuous testing

18
The methods and technology employed include:

• Unified Modelling language for modelling

• Layered Approach

• Repository for object oriented system development patterns and


frameworks.

• Component-based development

19
Object-Oriented Analysis

OOA process consists of the following steps.


• Identify the Actors
• Develop a simple business process Model using UML Activity diagram
• Develop the Use Case
• Develop Interaction diagrams
• Identifying classes.

20
Object-Oriented Design

In OOD process consists of:

• Designing classes, their attributes, methods associations, structures and protocols,


apply design axioms.

• Design the Access Layer

• Designing and prototype User Interface

• User satisfaction and Usability Tests base on the usage/Use Cases

• Iterate and refine the design

21
Iterative development and continuous Testing
• Development must be iterate and reiterate until you are satisfied with the system.

• Repeat the entire process, reworking the design or moving on to re-prototyping and retesting.

• Continue this refining cycle through the development process until you are satisfied with the
results.

• The prototype will be incremental transformed into the actual application.

• Usage scenarios can become test scenarios;

• Therefore, use case will drive usability testing.

22
UA repository
• In modern business, best practice sharing is a way to ensure that solutions to
process and organization problem.

• Best practice sharing eliminates duplication of problems solving.

• The idea promoted here is to create repository.

• That allows the maximum reuse of previous experience and previously


defined objects, patterns, frameworks, and user interfaces.

• Everything from the original user request to maintenance of the project as it


goes to production should keep in the repository.

• The repository should be accessible to many people.

23
Layered Approach
• Most software development tools are two layered
architecture interface and data.
• The functions of the interface from the function of the
business better to isolated each other.
• This approach also isolates the business from the details
of the data access.
• There are three layered approach. These are:
1. User Interface layer
2. Business layer
3. Access layer

24
Business Layer:
• Contains all the objects that represent the business.
• Shows how objects interact to accomplish the business process performed.
• These objects should not be responsible for the following:
1. Displaying details
2. Data access details

25
View Layer:

• The user interface layer consists of objects with which the user interacts as well
as the objects need to manage or control the interface.

• The user interface layer also called view layer.

• This layer typically is responsible for two major aspects of applications.


1. Responding to user interaction

2. Displaying business objects

26
Access Layer:

• The access layer contains objects that know to communicate with the place
where the data actually resides.

• Whether it be a relational database, mainframe, internet, or file.

• Regardless of where the data actually resides the access layer has two major
responsibilities:

1. Translate results

2. Translate request

27
THANK YOU!!

28

You might also like