Reference:
Kendal, S. (2009). Object Oriented Programming using Java. Simon Kendal & Ventus Publishing ApS
Learning Outcomes:
Discuss what is OOP
Describe the benefits of OOP
Describe the basic concepts of abstraction, encapsulation, generalization, and polymorphism
Programming Paradigm
Structured
Programs could be developed in sensible blocks that make the program more understandable and easier to maintain
Activity 1
Assume that we undertake the following activities on a daily basis. Arrange this list into a sensible order then split this list into three blocks of related activities and give each block a heading to summarize the activities carried out in that block.
Get out of bed
Eat breakfast
Park the car
Get dressed
Get the car out of the garage
Drive to work
Find out what your boss wants you to do today
Feedback to the boss on today’s results
Do what the boss wants you to do
Feedback 1
Organize related activities into groups; give each group a title that summarizes those activities
Get up: Go to work: Get out of bed Get the car out of the garage Eat breakfast Drive to work Get dressed Park the car
Do your job: Find out what your boss wants you to do today Do what the boss wants you to do Feedback to the boss on today’s results
>>>Structuring the list of instructions
Feedback 1
Sections of the structures can be improved
Go to work: Get the car out of the garage Drive to work Park the car
> listen to the local traffic and weather report > decide whether to go by bus or by car > if going by car, get the car and drive to work > else walk to the bus station and catch the bus
Programming Paradigm
Object Oriented
Model instructions with the data they manipulate and store these as components together
Advantage: reusable software components
Activity 2
Imagine a personal address book with some data stored about your friends Name, Address, Telephone Number