Professional Documents
Culture Documents
1/27/2018
John Roberts
2 It’s the first image that came up on my image tool for “roles” <shrug>
Overview
• Roles and Information
• Information Hiding
• Class Hierarchy
• Roles
• Information
3
4
Roles and Information
6
Overview
• Roles and Information
• Information Hiding
• Class Hierarchy
6
7 Why is this bold?
Information Hiding
8
Information Hiding
• Focus on WHAT the roles are (and mean) but NOT HOW
they are implemented
9
Information Hiding
• Instances of Professors
Jrob Kerry
lecture lecture
answer question answer question
grade spreadsheet grade spreadsheet
courses this term courses this term
students this term students this term
• Instances of Students
Monica Phil Shaka
study study study
do exercise do exercise do exercise
courses completed courses completed courses completed
courses this term courses this term courses this term
9
10
Message Passing
10
11
Message Passing
11
12
Message Passing
12
13
Classes and Instances
Instances, Message Passing (Why not Class?) Why isn’t the word Class in the title? (except for where its in the title to remind
Jrob
lecture
me to ask this question) - Classes are templates; an instance must be created
to act or be acted on
Jrob answer question
grade spreadsheet
courses this term
students this term
Message: grade exercise
Message: do exercise
Monica
study
do exercise
Monica
courses completed
courses this term 14
15
Overview
• Roles and Information
• Information Hiding
• Class Hierarchy
15
16 In this hierarchy, Professor is a subclass of Person. Usually true in reality as
Class Hierarchy well
• Organizes classes in a structured fashion to deal with
complexity
Superclass
Person
getName
getAge
getAddress
Name
Age
Address
Professor Student
lecture doExercise
16
Subclasses
17
Class Hierarchy
18
Class Hierarchy
19