bugshaw: (Default)
Add MemoryShare This Entry
posted by [personal profile] bugshaw at 06:24pm on 05/11/2005
Typing up my student's lecture notes this evening (Java objects and classes), I found the following come out onto the page:

mum is an object of the Parent class; son is an object of the Child class.
The mum object sends a message “Pull up your socks” to the son object, who performs the pullUpSox() method. son’s socks are private to him – mum cannot access his socks directly.

Well, it made me laugh.
There are 4 comments on this entry. (Reply.)
 
posted by [identity profile] alexmc.livejournal.com at 07:09pm on 05/11/2005
It is a really bad idea to have a class called "parent" or a class called child. It is a bit like changing your own name by deed poll to "What is your name"

I automatically assumed that the Child class was a child class of the Parent class whereas you didnt actually say that it was.

Oh, ok, it made me laugh too.
 
posted by [identity profile] bugshaw.livejournal.com at 07:41pm on 05/11/2005
I know - the Parent/Child thing confused me when I first looked back at my notes, especially as the first thing he'd talked about was a recap of object relationship types - aggregation and inheritance. Luckily, I was intelligent enough to divine his meaning and hope I have avoided ambiguity in the writeup.

I've just realised what my first LJ entry should have been -

"Hello, world"
 
posted by [identity profile] bibliofile.livejournal.com at 10:24am on 06/11/2005
son’s socks are private to him
That's when I laughed. Anyone who's been around younger kids knows that socks are quite public.
 
posted by [identity profile] bugshaw.livejournal.com at 02:03pm on 06/11/2005
That moment of absurdity was when I decided to record it in full.

The tutor went on to discuss the potential problem whereby if there were multiple parents and children, anyparent could tell any child to pull their socks up - and how we must implement the code carefully to ensure that parents cannot talk to other people's children like that!

September

SunMonTueWedThuFriSat
  1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21 22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30