Reply to Re: Classes, don't follow.

Your name:

Reply:


Posted by Jace Benson on 10/11/05 07:40

Well... I am trying to understand here. Before I start, thanks for all
the information you've given me.

So please correct me if I am wrong.

Classes are a container.. if you will something to put what a <thing>
does.
if for instance I was making a program on a pet. I would want to label
it Class Pet {...}
(dont be so tight on the gramatical errors, I am just trying to figure
this out).. Anyways In the class Pet I would put in it the
methods?(these are also the functions)? that the pet would do. So say
I wanted to call the class pet and make a new instance of a dog and i
wanted that dog to poop.
Would this be how i should look at that in OO programming?
//make this class
//classes dont create things methods do
Class Pet {
var $pets_name;
function ChooseAPet() {
//some function pulling data from an array printing
//it to a form to select it and send it back with a name
}
}
Class Action {
var $action;
function Action(){
//this will be called whenever the class is caled
//some thing like before but pulling data for what an animal can
do.
}
function Stop(){
//something to stop an action for instance
//a pet might take a long time to sleep but not long to jump
}
function Create(){
//when some actions happen things are created like stools
}
}

not the best example but this would be a valid theroized Class
design..?

I feel like i dont' get it. I under stand to seperate is good, but I
am lost.

[Back to original 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

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