Reply
Old 10-08-2012, 10:36 AM   #1 (permalink)
 
Status: Junior Member
Posts: 12



Default Do you know the Best explanation of Object Oriented Programming with a real life analogy to a PHP newbie?

I still can't get it.
If a man is an object then what?????????

elix is offline   Reply With Quote
Old 10-08-2012, 10:36 AM   #2 (permalink)
 
Status: Junior Member
Posts: 6



Default Do you know the Best explanation of Object Oriented Programming with a real life analogy to a PHP newbie?

i really dont

the thing is is that im just learning and i need help

please answere mine to help me learn.

i would like to make computer software and hardware when i gro up and just need a good place to start

http://answers.yahoo.com/question/index;_ylt=AkFDY.Zb8kk3_X0hOB1aXjPsy6IX;_ylv=3?qid=20121007155746AAiKmx5
Computerhodad is offline   Reply With Quote
more..
Old 10-08-2012, 10:36 AM   #3 (permalink)
 
Status: Junior Member
Posts: 1



Default Do you know the Best explanation of Object Oriented Programming with a real life analogy to a PHP newbie?

The idea behind object oriented programming is that you have classes which act like blueprints for objects. These classes define methods and properties of this class

Some real life analogies.

A car class could be defined like:
Class car{
String MFG;
String Make;
int year;
String color;
int maxSpeed;
int numOfDoors;
int numOfSeats;

//some methods it could have

speedUp(int speed)
slowDown(int speed)
steer(direction)
turnOnRadio(void)
turnOffRadio(void)
turnOnAC(int temp)
turnOffAC(void)
turnOnHeat(int temp)
turnOffHeat(void)
//and so on
}

The idea is that this class defines things about most cars in general and some things they can do.
Now when I create an object I would tell I have a red ford mustang 2002 and so on
This object belongs to me and I can change the properties of it or use its methods.

You could create multiple cars that belong to multiple people which have different colors, max speeds, number of doors, body styles.

I could make a class called gradebook and create a gradebook for each teacher, with a different number of students, names and grading scales. But each gradebook can calculate the letter grade, or the class average.

Most humans have two arms, two legs, two eyes and so on. They can walk, run, blink, talk, yell, sleep and so on. I can "instantify" myself and say I have two arms, brown eyes, brown hair, 5"6, and so on. I can "instantify" others with blond hair, blue eyes. With a "man" object I can make it run() to lower its weight() or goToWork() to improve its income.

Hope this helps!
Fenrir is offline   Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Safe operation within an object is ensured by? - object oriented programming? Asish Programming 0 06-13-2013 06:06 AM
VB.NET is said to be object oriented programming language whereas VB 6.0 is said to be component oriented. HOW? Adam Programming Languages 1 12-29-2012 11:06 PM
What is the difference between object oriented modelling and object oriented programming ? Unknown_User Programming 1 07-21-2012 01:06 PM
How the implementation and design of object oriented database systems is different from non object oriented da? Unknown_User Databases 0 06-24-2012 10:36 AM
What is the difference between an object oriented and text oriented programming language jason6d3h Programming Languages 1 09-08-2011 01:07 AM