SLIDE 1
2013-‑10-‑10 ¡ 1 ¡
Lecture ¡OO ¡
Object ¡Orienta3on ¡ OOA, ¡OOD ¡ Class ¡introduc3on ¡
Defini3ons ¡
- Programming ¡
– Working ¡out ¡algorithms ¡that ¡solve ¡problems. ¡
- Coding ¡
– Implemen3ng ¡algorithms ¡in ¡some ¡language. ¡
- Language ¡
– Interface ¡to ¡processor ¡capabili3es. ¡ – Formal ¡syntax ¡for ¡describing ¡an ¡algorithm. ¡
- Interface ¡
– Set ¡of ¡features ¡a ¡thing ¡provide ¡to ¡use ¡or ¡manipulate ¡it. ¡
- Paradigm ¡
– A ¡certain ¡way ¡of ¡expressing ¡a ¡program. ¡
Paradigms ¡
- Func3onal ¡programming ¡
– Lisp ¡ – Scheme ¡ – Python ¡
- Impera3ve ¡programming ¡
– Ada ¡ – C ¡ – Python ¡
- Object ¡orienta3on ¡
– Ada ¡ – C++ ¡ – Java ¡
Func3onal ¡Programming ¡
- Programs ¡evalute ¡expressions. ¡
- The ¡program ¡have ¡no ¡global ¡state. ¡
- Func3ons ¡are ¡purely ¡mathema3cal ¡and ¡depend ¡
purely ¡on ¡input. ¡No ¡side ¡effects. ¡
- Func3ons ¡are ¡treated ¡as ¡any ¡data. ¡
– Can ¡be ¡defined ¡“on-‑the-‑fly” ¡inside ¡other ¡func3ons. ¡ – Can ¡be ¡passed ¡as ¡parameter. ¡ – Can ¡be ¡returned ¡from ¡func3ons. ¡
- Lambda ¡calculus ¡and ¡recursion ¡are ¡central. ¡
Impera3ve ¡programming ¡
- A ¡program ¡consist ¡of ¡statements, ¡func3ons ¡
and ¡procedures ¡that ¡manipulate ¡a ¡program ¡
- state. ¡
- Side ¡effects ¡are ¡somewhat ¡common. ¡
- Execu3on ¡is ¡sequen3al ¡rather ¡than ¡recursive. ¡
- Focus ¡on ¡how ¡the ¡program ¡should ¡do ¡
something ¡step ¡by ¡step. ¡
- Very ¡common ¡approach ¡to ¡programming. ¡
Object ¡Orienta3on ¡
- A ¡program ¡consist ¡of ¡loosely ¡coupled ¡objects ¡that ¡
cooperate ¡to ¡solve ¡a ¡task. ¡Objects ¡are ¡oXen ¡modeled ¡ to ¡represent ¡an ¡abstract ¡concept ¡or ¡real ¡world ¡thing. ¡
- Objects ¡provide ¡an ¡interface ¡that ¡allow ¡controlled ¡
interca3on ¡with ¡the ¡object. ¡
- Objects ¡hide ¡internal ¡representa3on ¡and ¡state ¡from ¡
the ¡rest ¡of ¡the ¡world. ¡
- Emphasis ¡on ¡abstrac3on, ¡encasula3on ¡and ¡inheritance ¡
to ¡be ¡able ¡to ¡easily ¡swap, ¡replace, ¡modify ¡or ¡reuse ¡
- bjects. ¡ ¡
- Objects ¡strive ¡for ¡low ¡coupling ¡and ¡high ¡cohesion. ¡
- Objects ¡oXen ¡use ¡impera3ve ¡programming ¡internally. ¡