Object Orientation Basics
What is an Object
Objects are things. These things, have:
* An Identity
* A State
* A behavior
You can think of an object as being noun.
There are four basic principles to object orientation:
* Abstration
* Encapsulation
* Modularity
* Hierarchy
Abstraction
Abstraction
This is a method of minimizing the complexity of a system
by simplifying part the system to elements that are significant
to the user. In short, abstraction shields us from complexity.
An example of abstraction might be a programming language statement.
In BASIC you may do the following:
10 REM Hello World in BASIC
20 PRINT "Hello World!"
This simple action shields us from the complexity of the equivalent
Assembler translation below:
; Hello World for Intel Assembler (MSDOS)
mov ax,cs
mov ds,ax
mov ah,9
mov dx, offset Hello
int 21h
xor ax,ax
int 21h
Hello:
db "Hello World!",13,10,"$"
Most people would rather deal with the former than the latter. Abstraction
is good on multiple fronts. It shields us from complexity and allows us
to concentrate on part of the system as opposed to the whole.
This leads us to the next important concept, encapsulation.
