Re: Help on objects
| From: | benifactor | Date: | Thu, 05 Oct 2006 23:48:34 +0000 |
| Subject: | Re: Help on objects | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242654@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Robert Cummings" <robert@interjinn.com>
To: "Satyam" <Satyam@satyam.com.ar>
Cc: "Deckard" <ml@wordlife.eu>; <php-general@lists.php.net>
Sent: Thursday, October 05, 2006 2:16 AM
Subject: Re: [PHP] Help on objects
> On Thu, 2006-10-05 at 07:04 +0200, Satyam wrote:
> > I've seen you already had a good answer on the errors in the code so I
won't
> > go on that. As for OOP, the one design error you have is that you are
> > asking for an action, not an object. You want to make SQL inserts,
that is
> > your purpose, and that is an action, which is solved by a statement, not
by
> > an object. There is no doer. Objects are what even your English
teacher
> > would call objects while describing a sentence. You are asking for a
verb,
> > you don't have a subject, you don't have an object. Of course you can
wrap
> > an action in a class, but that is bad design. Classes will usually have
> > names representing nouns, methods will be verbs, properties adjectives,
more
> > or less, that's OOP for English teachers.
>
> Properties are very often nouns in addition to adjectives. For instance
> a linked list class will undoubtedly have noun objects referring to the
> current link, the next link, etc.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>