Categorized | News

Structuring an OOP app

Posted on 05 May 2002 by Demian Turner

The following article from Zend gives quite an interesting overview in how to structure an OOP applicationin PHP, in this case a weblog that allows for article posting, addition of comments, user management and internal messaging.  The first task is breaking down what role the classes will play in the application:

  • Actor Classes: Classes that represent people. Actor classes have their own attributes as well as the ability to perform actions
  • Data Classes: Classes that represent data. They have attributes, but usually do not have the ability to perform actions
  • Action Classes: Classes that perform actions. Can perform computation as well as act on other objects. More likely than not these classes won’t have specific attributes. Lots of business logic can be contained here.
  • Collection Classes: Objects that hold other objects

Click here for the full article.

Bookmark and Share

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up