Title: Structured Problem Solving
1Structured Problem Solving
- Object- Oriented Concepts 1
2Objectives
- After completing the work and attending this
session you will - Understand what is meant by an object-oriented
approach to computing - Understand the terms attribute, status and
protocol
3The idea of Objects
- An object is a piece of software that can receive
and act on a message sent to it. - On the right is a piece of text. This is can be
regarded as an object - We can send it messages.
The Quick brown fox jumps over the lazy dog.
4Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
5Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
6Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
7Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
8Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
9Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
10Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
11Sending Messages to Objects
- Bold on
- Italic on
- Bold, Italic off
- Font Size 30
- Font Colour Red
- Font Comic Sans
- Font Colour Green Copperplate Gothic Size 36
Italic
The Quick brown fox jumps over the lazy dog.
12Sending Messages to Objects
- Each piece of information that an object holds is
an Attribute. - The State of an object is the set of current
values of its Attributes
The Quick brown fox jumps over the lazy dog.
13Sending Messages to Objects
Text The Quick brown fox jumps over the lazy
dog. Colour Blue Justification Left Font
Type Tahoma Font Size 24 Bold Off Italic Off
The Quick brown fox jumps over the lazy dog.
This blue box describes the state of the text.
The items within it are called the attributes of
the text
14Sending Messages to Objects
MESSAGE Change Colour to Red
Text The Quick brown fox jumps over the lazy
dog. Colour Blue Justification Left Font
Type Tahoma Font Size 24 Bold Off Italic Off
The Quick brown fox jumps over the lazy dog.
The current state of the text.
15Sending Messages to Objects
MESSAGE Change Colour to Red
Text The Quick brown fox jumps over the lazy
dog. Colour Red Justification Left Font Type
Tahoma Font Size 24 Bold Off Italic Off
The Quick brown fox jumps over the lazy dog.
Text has now changed
The new state of the text.
16Sending Messages to Objects
The Quick brown fox jumps over the lazy dog.
- The Protocol for an object is the set of messages
that an object understands. - Two objects may behave very differently when
given the same message
17Sending Messages to Objects
The Quick brown fox jumps over the lazy dog.
18Classes of Objects
The Quick brown fox jumps over the lazy dog.
19Classes of Objects
- Student Class
- Furniture Class
Joanne Brett Abid
Chairs Cupboards Bookcases
20An Object Lesson
- Here is a Table in PowerPoint
- What are its attributes?
21An Object Lesson
- Rows 3
- Columns 3
- Border On
- Border Style Width 1pt
- Cell Contents
- (1,1) , (1,2) X etc.
- Background Clear
22Modelling the Real World
Computers attempt to model the real world. In
this case, TFs cluttered desk!