objects and components. the adaptive organization the competitive environment of businesses...

28
Objects and Components

Upload: hector-austin

Post on 27-Dec-2015

234 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Objects and Components

Page 2: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing
Page 3: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

The adaptive organization

The competitive environment of businesses continuously changing , and the pace of that change is increasing at an accelerating rate.

Where it was once possible for a company to stake out its marketing turf and defend its position for years, static positioning is now viable only in a few isolated industries.

For most companies today, the only constant is change.

Page 4: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Object OrientationBasic building blocks of a system are the OBJECTS black boxes encapsulating data and

procedures messages can be send and received by

objects object libraries and templates

Importance reusability maintainability flexibility

Page 5: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Database Evolution

File System Database OO - system

Page 6: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Why objects ?

Grady Booch:

simply because there appears to be no other way to economically produce an enduring and resilient programming system.

David A. Taylor

objects are the enabling technology for adaptive business systems

Planning !!!

Page 7: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

The waterfall model

projectdefinition

system study

design

programming

Installation

Post Imple-mentation

Project proposal report

Functional specifications

Feasibility report

design specifications

program specscode

tests of system performance

audit , feed-back

- intermediate reports

- go/nogo intervals

Page 8: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Number of problems

time

System reliability evolution

Page 9: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Why OO ? Good reasons

With the increasing complexity of the systems,

the waterfall model suffers from two illusions:

The analyst knows everything and understands the problem completely before implementation starts

The users read the system analysis report and approve it

Page 10: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Project management

Iterative styledevelop a series of solutions to a problem ,each of them closer to satisfying the

requirements( also called : evolutionary development )

Incremental styleBuilds system functionality a little at a time.The results are not entire solutions.

Matthew Pittman proposes iterative analysis and design combined with incremental development

Page 11: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

OO - Life cycleFacts: System requirements are not fully known at the

start knowledge of the system grows during

development better develop a system incrementally start with some core functions

object modeling

analysis

design

construction

fullsystemdefinition

coordination and reuse

OMGLife Cycle

Page 12: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

What is an object ?

An object is a software package that contains a collection of related procedures ( methods ) and data ( variables )An object is a data abstraction with a state, a behavior and an identitywhereby operations are encapsulated together with the data structures on which they are defined

B0923C7

12403PetersBrussels1 y comp

changeaddress

enrollgive grade

Page 13: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

The object paradigm

Five principles:

Abstraction

Encapsulation

Object communication , message

passing

Inheritance

Polymorphism

Page 14: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Abstraction

an abstraction is a simplified view of some part of reality, focusing on some aspects , suppressing others

good abstraction emphasizes on those details that are important for the actual observer

the use of abstraction makes it possible to postpone decisions regarding details

an object is an abstraction of both data and functionality, with a focus on the outside view , separating the implementation of the object from the essential

Page 15: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Abstraction focuses upon the essential characteristics of some object, relative to the perspective of the user

From: Grady BoochAbstraction

Page 16: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Encapsulation From: Grady Booch

Encapsulation hides the details of the implementation of an object

Page 17: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

EncapsulationEncapsulation is the mechanism by which an object is made to look like a black box to an external observer

It is the packaging of a set of ideas into one logical unit, which can be referred to as a single unit

Good encapsulation hides design decisions .

An external observer sees what the object does, not how it does it.

It is the basis for reusability

Page 18: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Classes

A Class is a software template that defines the methods and variables to be included in a particular kind of object.

objects of the same structure and behavior belong to the same class

an object belongs to a class or is an instance of a class

objects only exist at run-time classes are set up at design time

a class can contain rules that all instances must satisfy

Page 19: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Messages passingA message starts an operation on an object

A message is simply the name of an object, followed by the name of the method the object knows how to execute, and eventually followed by parameters

Objects can pass messages to other objects

Signature: The message signature contains the stipulation of the message format

a message consists of the name of a method and the required arguments

the set of messages to which an object responds is the behavior of the object

Page 20: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Message passing

The task of software development is to engineer the illusion of simplicity.

Page 21: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Message InterfaceMessage interface

The set of messages an object commits to respond to.

A class must specify the messages that objects of this type will make available to other objects

Interfaces protect objects from being corrupted by other objects

protect other objects from depending on its internal structure

Interfaces may be segmented by combining them into composite interfaces

Page 22: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Anatomy of a message

A message consists of three parts

1. A receiver object2. A method the receiver knows how to execute3. An ordered set of parameters that this

method requires to carry out this function (optional)

Vehicle Turn : 90

receiver method parameter

Messages conform to signatures

Page 23: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Inheritancethe ability of an instance of a class C to use not only the methods and variables defined for C but also those designed for an ancestor of CInheritance allows new classes to be build incrementally on existing classesMessage interfaces are also inherited

students and staff members are sub-classes of person

Person

changeaddress

student

grade

Staff member

pay

Page 24: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Composite objectsObjects can contain other objects(Composite objects)

Collection class is a special kind of class

Benefits of Composition

even a deeply nested structure can be treated as a single, unified object

this helps manage complexity

Delegation

when an object assigns a task to another object

Page 25: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Method overriding

it is possible to override methods

Polygon

Give area

HexagonTriangle

Give area

Rectangle

Give area

Page 26: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Attention

Person

Head Leg

This is not inheritance (but Aggregation)

Page 27: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Polymorphism

The ability of different objects to respond differently to the same message is called POLYMORPHISM

e.g. DRAW NEW

A variable can point to an object whose class is not absolutely known

Page 28: Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing

Number of problems

time

OO-System Reliability

With OO development techniques A system is never replaced

entirely continuous evolution lower implementation risk