Reply to Re: php 5 classes: public, protected and private

Your name:

Reply:


Posted by Curtis on 12/03/06 07:00

> That's just your opinion. Where does it say that I *MUST* define and use an
> interface before I can access a class method? Interfaces are optional
> (especuially in PHP) so it is not wrong to excercise the option NOT to use
> them. I can define a class method and access that method without using an
> interface, and that is what I choose to do.

No one is saying that you have to use interfaces. The point is that it
is there to help in organizing and creating classes, the same goes for
visibility keywords. Just because you don't have to use these, doesn't
mean that you should not use them.

I can see an advantage in using interfaces and/or visibility keywords
in PHP, if one is creating a large library, or to help communications
between a team of developers. These features can help track down where
a problem is if something isn't working right, or just for clarifying
the particular usage for the class or its members.

BTW, I do not believe there is any controversy over what encapsulation
is; if so, I haven't heard about it.

[Back to original 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

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