You are on page 1of 6

UNI VERSI TY OF E MBU

DEPART ME NT OF MAT HE MATI CS, COMP UTI NG AND INF OR MATI ON


TECHNOL OGY

CSC 221: OBJ ECT ORI ENTED ANALYSI S, DESI GN AND PROGRA MMI NG

WRI TTEN BY: EDI TED BY:


Dr. E. C TOO

Copyri ght © UNI VERSI TY OF E MBU, J ANUARY 2022


All Ri ghts Reserved
Obj ect ori ented anal ysis, desi gn and progra mmi ng( OOAD&P)

Evol uti on of Obj ect Ori ented Paradi g m

The OOP appr oach is utmost co mmonl y used appr oach nowadays. OOP is bei ng used for
desi gni ng l arge and co mpl ex appli cati ons. Bef ore OOP many pr ogra mmi ng appr oaches exi st ed
whi ch had many dra wbacks.

These pr ogra mmi ng approaches have been passi ng t hr ough revol uti onar y phases j ust li ke
co mput er har dwar e. Initiall y for desi gni ng s mall and si mpl e pr ogra ms, t he mac hi ne
l anguage was used. Next ca me t he Asse mbl y Language whi ch was used for desi gni ng l arger
pr ogra ms. Bot h machi ne and Asse mbl y l anguages are machi ne dependent. Next
ca me Procedural Progra mmi ng Approach whi ch enabl ed us t o writ e larger and hundred li nes
of code. Then i n 1970, a ne w pr ogra mmi ng appr oach call ed Struct ured Progra mmi ng
Approach was devel oped for desi gni ng medi u m sized pr ogra ms. In 1980' s t he si ze of progra ms
kept i ncreasi ng so a ne w appr oach known as OOP was i nvent ed.

The obj ect-ori ent ed paradi g m t ook its shape from t he i nitial concept of a ne w pr ogr a mmi ng
appr oach, whil e t he i nt erest i n desi gn and anal ysis met hods ca me much l at er.
 The first obj ect –ori ent ed l anguage was Si mul a (Si mul ati on of real syste ms) t hat was
devel oped i n 1960 by researchers at t he Nor wegi an Co mputi ng Cent er.
 In 1970, Al an Kay and his research gr oup at Xerox PARK creat ed a personal comput er
na med Dynabook and the first pure obj ect-orient ed pr ogra mmi ng l anguage ( OOPL) -
S mallt al k, for progra mmi ng t he Dynabook.
 In t he 1980s, Grady Booch published a paper titled Obj ect Ori ent ed Design t hat mai nl y
present ed a desi gn for the pr ogra mmi ng l anguage, Ada. In t he ensui ng editi ons, he
ext ended his i deas t o a co mpl et e obj ect –ori ent ed desi gn met hod.
 In t he 1990s, Coad i ncorporat ed behavi oral i deas t o obj ect-ori ent ed met hods.
The ot her si gnifi cant innovati ons were Obj ect Modelli ng Techni ques ( OMT) by Ja mes
Ru mbaugh and Obj ect- Orient ed Soft ware Engi neeri ng ( OOSE) by Ivar Jacobson.
Obj e c t - Or i e nt e d Anal ys i s ( OOA)

Accor di ng t o Gr ady Booch OOA i s a met hod of anal ysis t hat exami nes requi re ment s from t he
perspecti ve of t he cl asses and obj ects f ound i n t he vocabul ary of t he probl em domai n”.

OOA i s t he first techni cal acti vit y perf or med as part of obj ect ori ent ed soft ware engi neeri ng.
The t echni que i nvol ves identifi cati on of soft ware engi neeri ng ( SE) require ment s and
devel op ment of soft ware specifi cati ons i n for m of obj ect model.

In OOA, require ment s are or gani zed around obj ects, whi ch i nt egrat e bot h dat a and functi ons.
They are modell ed aft er real- worl d obj ects t hat t he syst e m i nt eracts wit h. The pri mar y t asks i n
obj ect-orient ed anal ysis (OOA) are −

1. Identifyi ng obj ects


2. Or gani zi ng t he obj ects by creati ng obj ect model diagra m
3. Defi ni ng t he i nt ernals of t he obj ects, or obj ect attribut es
4. Defi ni ng t he behavi or of t he obj ects, i. e., obj ect acti ons
5. Descri bi ng how t he obj ect s i nt eract

Obj ect- Ori ented Desi gn

Accor di ng t o Gr ady Booch OOD i s a met hod of desi gn encompassi ng the process of obj ect-
ori ent ed decompositi on and a not ati on f or depi cti ng bot h l ogi cal and physi cal as well as st ati c
and dynami c model s of the syst e m under desi gn”.
OOD enco mpasses applicati on of t he concept ual model creat ed duri ng OOA.
OOD, concept s i n t he anal ysis model, whi ch are t echnol ogy−i ndependent, are mapped ont o
i mpl e menti ng cl asses, constrai nts are i dentified and i nt erfaces are desi gned, resulti ng i n a model
for t he sol uti on do mai n, i.e., a det ail ed descri pti on of how t he syst e m is t o be built on concret e
technol ogi es.
The i mpl e ment ati on det ails generall y i ncl ude −

 Restruct uri ng t he cl ass dat a (if necessar y),


 I mpl e ment ati on of met hods, i.e., i nt ernal dat a struct ures and al gorit hms,
 I mpl e ment ati on of control, and
 I mpl e ment ati on of associati ons.

Obj ect- Ori ented Progra mmi ng

Accor di ng t o Gr ady Booch OOP is a met hod of i mpl e ment ati on i n whi ch programs are organi zed
as cooperati ve coll ecti ons of obj ects, each of whi ch represent s an i nst ance of some cl ass, and
whose cl asses are all members of a hi erarchy of cl asses unit ed vi a i nherit ance rel ati onshi ps ”.
OOP paradi gmis built upon obj ects (havi ng bot h dat a and met hods) t hat aims t o i ncor porat e t he
advant ages of modul arit y and reusabilit y.
Obj ects, whi ch are usuall y i nst ances of cl asses, are used t o i nt eract wit h one anot her t o desi gn
appli cati ons and co mput er progra ms.
The i mport ant feat ures of obj ect –ori ent ed pr ogra mmi ng are −

 Bott om–up appr oach i n progra m desi gn


 Pr ogra ms or gani zed around obj ects, grouped i n classes
 Focus on dat a wit h met hods t o operat e upon obj ect’s dat a
 Int eracti on bet ween obj ect s t hrough functi ons
 Reusabilit y of desi gn t hrough creati on of ne w cl asses by addi ng feat ures to exi sti ng
cl asses
So me exa mpl es of obj ect-ori ent ed pr ogra mmi ng l anguages are C++, Java, Smallt al k, Del phi, C#,
Perl, Pyt hon, Ruby, and PHP.
Advant ages of object-oriented progra mmi ng i ncl ude:
1. I mproved soft ware- devel op me nt producti vity:
Obj ect-orient ed pr ogra mmi ng is modul ar, as it provi des separati on of duties i n obj ect -based
pr ogra m devel op ment. It is also ext ensi bl e, as obj ect s can be ext ended t o i ncl ude ne w
attri but es and behavi ors. Obj ects can also be reused wit hi n an acr oss appli cati ons. Because of
t hese t hree fact ors – modul arit y, ext ensi bilit y, and reusabilit y – obj ect-orient ed pr ogra mmi ng
pr ovi des i mpr oved soft ware- devel op ment pr oducti vit y over traditi onal procedure- based
pr ogra mmi ng t echni ques.
2. I mproved soft ware mai nt ai nability: For t he reasons menti oned above, obj ect ori ent ed
soft ware is also easi er t o mai nt ai n. Si nce t he desi gn is modul ar, part of t he syst e m can be
updat ed i n case of issues wi t hout a need t o make lar ge-scal e changes.
3. Faster devel op me nt: Reuse enabl es fast er devel op ment. Obj ect-ori ent ed pr ogra mmi ng
languages co me wit h ri ch li brari es of obj ects, and code devel oped duri ng proj ects is also
reusabl e i n fut ure pr oj ects.
4. Lower cost of devel op me nt: The reuse of softwar e also l owers t he cost of devel op ment.
Typi call y, mor e effort is put i nt o t he obj ect-ori ented anal ysis and desi gn, whi ch l owers t he
overall cost of devel op ment.
5. Hi gher- quality soft ware: Fast er devel op ment of soft ware and l ower cost of devel op ment
all ows mor e ti me and resources t o be used i n t he verificati on of t he soft ware. Alt hough qualit y is
dependent upon t he experience of t he tea ms, obj ect-ori ent ed pr ogra mmi ng tends t o result i n
hi gher-qualit y soft ware.
Concepts of OOP:

 Obj ects
 Cl asses
 Dat a Abstracti on and Encapsul ati on
 Inheritance
 Pol y mor phi s m

Obj ects

Obj ect is an abstract data t ype ( ADT) creat ed by a devel oper. It can i ncl ude multi pl e pr operti es
and met hods and may even cont ai n ot her objects. In most progra mmi ng l anguages, objects are
defi ned as cl asses.

Obj ects are t he basi c run-ti me entities i n an obj ect-ori ent ed syst e m. Pr ogrammi ng pr obl e mis
anal yzed i n ter ms of obj ect s and nat ure of communi cati on bet ween t he m. When a pr ogra mis
execut ed, obj ects i nt eract wit h each ot her by sending messages. Different obj ects can also
i nt eract wit h each ot her wi t hout knowi ng t he det ails of t heir dat a or code.

Cl asses

A cl ass is a bl uepri nt of an obj ect. You can t hi nk of a cl ass as a concept, and t he obj ect is t he
e mbodi ment of t hat concept.

An Obj ect is an i dentifi abl e entit y wit h so me charact eristi cs and behavi our.

An Obj ect is an i nst ance of a Cl ass. When a cl ass is defi ned, no me mor y is all ocat ed but when
it is i nst anti at ed (i. e. an obj ect is creat ed) me mor y is all ocat ed.

Dat a Abstracti on and Encaps ul ati on

Dat a Abstracti on refers t o t he act of representi ng essenti al feat ures wit hout i ncl udi ng t he
backgr ound det ails or expl anati ons.

Dat a abstracti on refers to pr ovi di ng onl y essential i nf or mati on about t he dat a t o t he out si de
worl d, hi di ng t he background det ails or i mpl e ment ati on.

Encaps ul ati on - St ori ng dat a and functi ons i n a singl e unit (cl ass) is encapsul ati on.

Encapsul ati on is defi ned as wr appi ng up of dat a and i nf or mati on under a si ngl e unit.

Encapsul ati on is defi ned as bi ndi ng t oget her t he dat a and t he functi ons t hat mani pul at e t he m

Dat a cannot be accessi ble t o t he out si de worl d and onl y t hose functi ons whi ch are st ored i n t he
cl ass can access it.
I nhe r i t anc e

The capabilit y of a cl ass t o deri ve pr operti es and charact eristi cs fro m anot her cl ass is call ed
Inherit ance. Inherit ance is one of t he most i mportant feat ures of Obj ect - Ori ent ed
Pr ogr a mmi ng.
 Sub Cl ass( deri ved cl ass): The cl ass t hat i nherits pr operti es fro m anot her cl ass is call ed
Sub cl ass or Deri ved Cl ass.
 Super Cl ass ( base cl ass): The cl ass whose pr operties are i nherit ed by sub cl ass is call ed
Base Cl ass or Super cl ass.
 Re us ability: Inherit ance supports t he concept of “reusabilit y”, i. e. when we want t o creat e
a ne w cl ass and t here is already a cl ass t hat i ncl udes so me of t he code t hat we want, we can
deri ve our ne w cl ass from t he exi sti ng cl ass. By doi ng t hi s, we are reusi ng t he fi el ds and
met hods of t he exi sti ng cl ass.
Pol y morphi s m

Pol y mor phi s m means t he abilit y t o t ake mor e t han one for m. An operati on ma y exhi bit different
behavi ors i n different i nstances. The behavi or depends on t he dat a t ypes used i n t he operati on.
Pol y mor phi s mis ext ensivel y used i n i mpl e menti ng Inheritance.

Dyna mi c Bi ndi ng: In dyna mi c bi ndi ng, t he code t o be execut ed i n response t o functi on call is
deci ded at runti me.

Me ss age Passi ng: Obj ect s co mmuni cat e wit h one anot her by sendi ng and recei vi ng
i nf or mati on t o each ot her. A message for an obj ect is a request for execut i on of a pr ocedure
and t heref ore will i nvoke a functi on i n t he recei vi ng obj ect t hat generat es t he desired results.
Message passi ng i nvol ves specifyi ng t he na me of t he obj ect, t he na me of the functi on and t he
i nf or mati on t o be sent.

You might also like