You are here: Re: Going OO « PHP Programming Language « IT news, forums, messages
Re: Going OO

Posted by LaieTechie on 04/01/06 09:20

On Sat, 18 Mar 2006 12:34:01 +0000, elyob wrote:

> I've always been a procedual coder, and am looking to get into OO asap.
> Any hints and tips appreciated, I've not totally got my head around it
> yet.

In my first OOP course, the instructor told us that objects are black
boxes with attributes (properties) and actions (methods). Objects are
categorized into classes. All objects of the same class have the same
attributes (maybe different _values_, though) and the same actions.

A class may have a super class and / or some sub classes. Super classes
are more general ("abstract") and sub classes are more specific
("concrete"). This inheritance pattern is general described with an "is
a" phrase. A Malibu is a Car. A Car is a Vehicle.

Besides inheritance, you can aggregate objects together. This is
described with "has a". A Car has an Engine. When you tell a Car to
"turn on" it delegates that command to its Engine.

The whole point of using objects and classes is abstraction. You program
to a certain interface ("API") without having to worry about the specifics
of how it gets its job done.

HTH,
Laie Techie

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация