I’m taking a Java class right, and having a little bit of trouble wrapping my head around the concept of object-oriented programming and how to implement it. So, I asked my dad for some advice, and this is how he responded:
"Object oriented thinking:
Imagine a planet, any planet. How do you describe a planet? These are the properties.
The planet has it's own gravity,
It's own sky color,
It's own funny looking, sexy locals - if it is a 'star trek' type of planet
It's own monsters.
What do you do on the planet? These are the methods.
Look at the sky,
Chase the women
Run from the monsters
So Capt Kirk lands on Boiseity, what does he find?
Gravity - normal
Rainfall - dry
Local women - nice clean cut Mormons
Local monsters – chipmonks
These are the unique properties of the Boiseity planet.
Now Capt. Kirk lands on CapitolHillia, what does he find?
Gravity - .95 earth normal
Rainfall - wet
Local women - grunge
Local monsters – panhandlers
CapitolHillia and Boiseity are both unique objects of class Planet.”
Fighting aliens makes so much more sense than withdrawing funds from a bank account.