Which of these is the correct/better way of writing a class?
Posted: Wed Nov 01, 2006 10:36 am
Example 1
Example 2
Code: Select all
class newClass
{
function newClass()
{
$this->doFirstThing();
$this->doSecondThing();
$this->doThirdThing();
}
function doFirstFirstThing()
{
// do something here
}
function doSecondThing()
{
// do something here
}
function doThirdThing()
{
// do something here
}
}Code: Select all
class newClass
{
function newClass()
{
$this->doFirstThing();
}
function doFirstFirstThing()
{
// do something here
$this->doSecondThing();
}
function doSecondThing()
{
// do something here
$this->doThirdThing();
}
function doThirdThing()
{
// do something here
}
}