Friday, January 25, 2013

Introduction to Object Oriented Programming


Object Oriented Java (introduction)

If you set out to truly understand how an automobile works, down to tiniest detail of how each nut and bolt performs, you could be in over your head---especially if do not have a degree in mechanical engineering. On the other hand, if the goal is a simpler one such as "to drive a car", it would seem to be a more achievable goal, by order of magnitudes. The mechanics of vehicle control such as steering, braking and accelerating are more manageable to keep in our heads as compared to principles of hydraulics or the inner workings of the internal combustion engine.

Complexity

We are surrounded by complex systems in our daily lives, and a career in programming will not shield you from that---au contraire. Our saving grace is that we have gotten pretty good at dealing with complexities. Take for example the plants that you have at home, you don't need to know the gory details of its biological structure in order to know that you need to give it some sun and water lest it will die. Another example is the light switch, you don't need a degree in electrical engineering to know that you if you flip the switch one way, its lights out---flip it another way and its lights on.
Computer scientist have grappled with complexities through the ages and have managed to develop tools to manage software complexities. One of the goals of complexity management is to engineer the illusion of simplicity---to hide the working details of a complex system in order for it to be usable.
There appears to be an inherent limit in the capabilities of our brain to deal with a swarm of information, we just can't deal with all of it---at once. The silver lining, like I mentioned earlier is that we have gotten pretty good at dealing with an avalanche of information. We have developed a coping mechanism called "abstraction"
A new employee on a large organization cannot and will not be able to comprehend all operational tasks that happens in the organization. He cannot possibly know the tiniest work details of each and every employee in the company. If you will just but give him a little time in the company, not only will be able to re-orient himself, he can also do something really productive that adds value to the company. So what happened between then and now? What makes us capable of navigating complex systems now but not then? The answer is, our minds oriented itself and adapted to its new environment.
Our minds focused on just a few items while ignoring the other inessential details of the others. It then moved on to other parts of the complex system forming hierarchies of concepts that builds on top of one and then another. The information bottleneck was broken by dealing with it in chunks. When we focus on specific chunks, we are choosing to deal with idealized and generalized model of the object right in front of us thus increasing its semantic content. This abstraction process is responsible why we are capable of understanding very complex systems.

Learning objectives

Abstraction is a key and foundational concept in OOP. There is no way around it. You will not go far in OOP and hence, Java programming without understanding the concept of process of abstraction. You also need the ability to leap from the OOP concepts to their Java implementations---those are the things we need to learn at the moment.

Key concepts

There are a couple of criteria that a programming language needs to meet before it can be considered a OOP language. It needs provide a facility to effectively implement the process ofabstraction. It needs to provide a way to reuse functionality by means of extension---inheritance. It needs to have a mechanism to protect data and type from inadvertent and unintentional state changes---encapsulation. It needs to have a mechanism to effect polymorphism and it needs to have a mechanism for grouping some programming constructs such as methods and classes---encapsulation.

Abstraction

Abstraction is an activity where the essential characteristics of something is distilled. It makes that something different from other somethings. For example, if you think hard about an elevator and try to list down the characteristics, what would they be? How is an elevator different from other modes of transport such as an escalator or a conveyor?
We cannot simply list move up and move down, while these set of behaviors differentiate the elevator from the conveyor (which simply moves to the left and to the right), it does not differentiate it effectively from an escalator. Even if we incorporate the idea that an elevator stops in between floors, it still does not differentiate it because the escalator also takes us from floor to floor. We can incorporate the behavior of skipping floors and that will be an effective differentiator because an escalator cannot skip floors.
If we summarize the behavior of the elevator, we can come up with two behavior-item---moveDownToFloor() and moveUpToFloor(). That is the essence of an elevator object. The tricky part is how to know when to stop adding or removing behavior from an object. Unfortunately, abstraction is an acquired skill, and you can only get better at it overtime if you do it lots of times. I can tell you from practice that abstraction is not so much as identifying a thousand (unimportant) behavior for an object. On the contrary, abstraction is more an exercise on reduction. Try to remove behavior from an object until you are down to a bare minimum. Let's take a shoe object for an example. You can remove the heels of a shoe and it still will be a shoe. You can remove the laces and it still (barely) is a shoe---but you cannot remove its sole.
The abstracted list of behavior of an object is known as a Type---this is an important terminology in OOP and Java, that is why I am emphasizing it in this section. All objects in Java must have at least one type---it can have more, but not less.


Call me and you will get the knowledge and skills you need instantly.
For inquiries contact me on my mobile number or email me at inquiry@eglobiotraining.com. View my multiply site http://erwinglobio.multiply.com
 
 
Prof. Erwin M. Globio, MSIT
Senior IT Lecturer
Far Eastern University
Email Address: inquiry@eglobiotraining.com
Skype: erwinglobio
 
 
Call Now:
 
SMART: 09393741359
SUN: 09323956678



No comments:

Post a Comment