Professional Documents
Culture Documents
Object Oriented Concepts and Unified Modelling Language (UML)
Object Oriented Concepts and Unified Modelling Language (UML)
concept
OOP
Literature
ObjectOrientedAnalysisandDesign AuthorsMcLaughlin,PolliceandWest O'Reilly (AvailableinLibrary)
concept
OOP
CourseObjectives
Introducebasicconceptsandprinciplesof
ObjectOrientedparadigm
IntroducebasicUMLnotationsassociated
withObjectOrientedconcepts
PresentsomeofthebasicUMLmodelling
approachesandexamples
LearnhowtodrawandinterpretUseCase
andClassdiagram(s)
concept
OOP
Objectives:
HistoryofObjectOrientation(OO) DefinitionofOOP? Basic(OO)Concepts Basic(OO)DesignElements
concept
OOP
HistoricalDevelopment
ObjectOriented(OO)firstmentionedin1960
Objectasentitywasintroducedby OleJohanDahl(programmer)&KristenNygaard atNorwegianComputingCentreinOslo
ThenameoftheirlanguagewasSIMULA1
aspecializedprogramminglanguageforsimulation
Note!Simula1wasnotacompleteOOPlanguage
concept
OOP
TheSimulaStory
"The status on the Simulation Language (Monte Carlo Compiler) is that I have rather clear ideas on how to describe queuing systems, and have developed concepts which I feel allow a reasonably easy description of large classes of situations. [...] The work on the compiler could not start before the language was fairly well developed, but this stage seems now to have been reached. The expert programmer who is interested in this part of the job will meet me tomorrow. He has been rather optimistic during our previous meetings."
concept
HistoricalDevelopment2
In1970SmalltalkwasinventedatXeroxPARC AlanKay
Smalltalkwasfirsttoimplementmessage passing
In1985Eiffelwasbornby BertrandMeyerandsupports:
concept
OOP
HistoricalDevelopment3
In1979developmentofC++wasstartedby
BjarneStroustoup
OOP
Resultsofdevelopment
Newwayofthinkinginsoftwaredevelopment
intermsofrealworldobjects
Newmethodsofsoftwaredevelopment
Evolutionmodel,Iterationmodel(RUP),etc...
Newwayofanalysingproblemstatement
Basedonclassesandobjects
Awayofimplementingconcepts
abstraction,inheritance,etc...
concept
OOP
WhatisOOP?
Object-oriented programming is a method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class, and whose classes are all members of a hierarchy of classes united via inheritance relationships.
concept
OOP
10
BasicConcepts
ObjectOrientedParadigm/Concept Abstraction Encapsulation Modularity Hierarchy Polymorphism*
concept
OOP
11
Abstraction
Isaboutgroupingofgeneralcharacteristicsofan objectidentifiedinproblemdomainthatdistinguishit fromallotherkindsofobjects.
AbstractionistheRepresentationofessential
featuresofanobject.
OOusesabstractiontodepictclasses Abstractionallowmanagementofcomplexity
byconcentratingonessentialcharacteristicsthat makesanentitydifferentfromothers.
12
concept
OOP
AbstractionExample
Products 13
OOP
Encapsulation
Encapsulation is an OO design concept, which provides the ability to hold all features of an object in virtual container while allowing changes in requirements to be effected on the object.
changes changes
It separates implementation of objects behaviour from its public interface It is sometimes called information hiding. It allows object behaviour to be used without knowing its implementation
Offers
concept
OOP
Protects objects internal state Make changes without affecting other objects
EncapsulationExample
Considerproductorderapplication.
concept
OOP
15
Modularity
Modularity
can be defined as the process of breaking up of a complex system into small, self contained pieces that can be managed easily. and subsystems support the definition of the modularity. are independent modules
Packages
Classes
concept
OOP
16
Modularity
Thebreakingupofsomethingcomplexinto
manageablepieces
Order Entry
Order Processing System
concept
OOP
17
Hierarchy
Any
ranking or ordering of abstractions into a tree-like structure. of hierarchy: Class Aggregation Containment Inheritance Partition Specialization
18
Type
concept
OOP
HierarchyExample
Increasing abstraction
Levelsofabstraction
Asset
Real Estate
Savings Checking
Decreasing abstraction
Stock
Bond
concept
OOP
19
Polymorphism
abilitytodesignafunctionordatatypesuch
thatitcanreactdifferentlytodifferent situations
Youcandefineagenericobjecttotakedifferentform Defineafunctionwhichprovidesameservicebutdifferent
messagedependingandmemoryontheobject
Example:
CowaCow=newCow(jojo");
OOP
Thinkofshapesclassesandarea_function()
20
BasicElements
Object Class Attribute Operation Message Interface
OOP
21
WhatisanObject?
A
concrete manifestation of an abstraction; an entity with a well-defined boundary and identity that encapsulates state and behaviour; an instance of a class.(Booch, 1999) object has:
State:
An
a condition in which an object may be at a time, implemented by a set of properties (attributes) with their values and the relationships with other objects) Behaviour: is about how the object act and react Identity: makes two objects different even in case they have the same state and behaviour
concept
OOP
22
Objectandproperties
concept
OOP
23
WhyObjects?
Objects
promote They
In
a problem domain nouns and noun phrases help in identifying the objects.
concept
OOP
24
ObjectType..
PhysicalObject:
objectswecantouchandfeel(books,abus,acomputer,etc..)
ConceptualObject:
intangibleobjectswhichplaysaroleinaDomain Example:
DomainObject:
tendstobestableinthedevelopmentlifecycle donotchangeevenifthereisachangeinrequirements
concept
OOP
Example:(Customers,Teller,andbankinATMsystem)
25
..ObjectType
ImplementationObject:
Objectswhicharenotrelatedtorealworldentities Changewhenrequirementschange Example:
accountreports/accountslip
ActiveObject:
Objectsthatcanchangeitsownstate Itisreferredtoasanobjectswithlife Theyareusuallyimplementedasprocessesorthreads Example:
timerandclock
PassiveObject:
changestheirstateonlyuponreceivingexternalmessage
OOP
26
concept