You are here: Re: Object Oriented PHP « PHP Programming Language « IT news, forums, messages
Re: Object Oriented PHP

Posted by Chung Leong on 11/24/05 07:31

Angelos wrote:
> But although that's working... it doesn't seem to be really OO :p
>
> So can you tell me what I can do ?

Errrr, stop pretending that you have an OOP design? You're basically
programming procedurally with the use of classes. If your class methods
are regular regular functions, you wouldn't be having the problem
you're having now.

One of the tenets of OOP is encapsulation--codes deal with a different
concerns should be independent and self-contained. When you have one
class that does one thing (say validation) directly dependent on
another class, doing something quite unrelated (say logging), the
design is rubbish. For the situation you described, you would want some
kind of slot/socket mechanism. In a typical PHP script though, such
complexity is really an overkill.

 

Navigation:

[Reply to this 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

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