[thelist] php design question

Steve Lewis slewis at macrovista.net
Tue Nov 19 14:14:01 CST 2002


Tom Dell'Aringa wrote:
> --- rudy <r937 at interlog.com> wrote:
>>my menu items come out of the database, so i don't understand why
>>i would then have to build them into objects

>
> You know this  might be the crux of the issue I was after in my
> original post. It's relatively simple to pull data out of a DB and
> pop it into a page, even on multiple pages. It has very little
> overhead. Now, instead, I could take the extra time to write an
> object for it. I understand what an object does and how it works, but
> like some others I'm still not seeing a real added value.

Let me first say I am a big fan of OO Development in general. I have
"seen the light" in a large-scale networked simulation I worked on a
couple years ago in a team of 4 folks, and we were only one team among
6.  The things I saw done in Java were inspiring. Because of that
project JavaDoc is my close friend.

On the other hand, I have worked with jsp and java servelets, and seen
several more.  I was unimpressed.  The following is an excerpt from my
off-list reply to rudy (trying to explain the difference between using
includes and using classes) which agrees with Tom and Rudy's position:

/Thanks to SQL, I have a useful 'object' already.  I call it a row.  I
get one or more of these 'objects,' all instances of a 'class' / data
structure I specified, and can manipulate these instances individually,
or en-masse, using whatever qualifiers I want.  I can find a row in the
states table where name='Oregon' more easily than I can search the
structure of state-objects for the state-object where
state.name=='Oregon' which means that OO would be less efficient./

/SQL is also far more powerful than the traditional OO methodology, but
then again in the traditional OO methodology you don't frequently need
to manipulate all objects WHERE birthday BETWEEN today() AND
dateadd(month, 1, today())./

/Encapsulation is about having well defined methods of working with
individual objects.  How often do you do that in web-apps?  I don't do
it very often, that is for sure./

--Steve




More information about the thelist mailing list