Re: everything as classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 3, 2008 at 10:33 AM, robert <roadtested@xxxxxxxxx> wrote:

> Along the lines of a previous post "How to get a code review", I am
> curious if it is overkill to create everything in classes. For example, a
> movie website where there is a class for the movie datatype, class for
> getting/adding/deleting/updating movie's data to the database, and class for
> displaying the data. (Of course there are classes for  general functionality
> like sql database connection etc.) For listing movies alone there are at
> least 4 different inheritance classes for chronological, alphabetic,
> category and keyword. Anyway this is how I coded something similar but for
> Flash/Actionscript site but I'm not sure about a PHP site. I appreciate your
> comments.
> - robert


to each his own; i am somewhat of an oop zealot, but i will advise u to heed
the reality that php affords the use of functions in the global namespace
and this feature is often useful even if an application is oop-centric.

sometimes being able to just crank out a function and be done w/ it is nice
:)  and other times it makes sense from a design perspective to offer
'convenience' functions in the global scope, which often times may actually
dip into functionality implemented in a class.  this sort of stuff will be
getting a twist in days to come (php 5.3+) when we will be able to write
functions (that arent class members) and segregate them from the global
scope albiet namespaces.


-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux