Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: OO Design Question

Started 1 month, 1 week ago by JulianRead101
The Application I have built a web application that allows a company to manage its clients and the projects they are doing for those clients. The app is built using PHP5 + Zend Framework. I currently have a project class that is populated from the database on creation and has a number of different methods. The Problem I must now change the system so that clients can ...
Site: Dev Shed Forums - Open Source web development  Dev Shed Forums - Open Source web development - site profile
Forum: Software Design  Software Design - forum profile
Total authors: 2 authors
Total thread posts: 4 posts
Thread activity: no new posts during last week
Domain info for: devshed.com

Other posts in this thread:

DevCoach replied 1 month, 1 week ago
IMHO inheritance is often overused by people new to OO design. In this sort of situation delegation is often better. I would have a separate PaymentPolicy class that the Project class can have as an attribute. This would then be subclassed into FixedPricePolicy and PayAsYouGoPolicy (and maybe others in the future). This class heirarchy would handle anything to do with payment....

DevCoach replied 1 month, 1 week ago

JulianRead101 replied 1 month, 1 week ago
Thanks for the reply, that makes a lot of sense. I will look into implementing it now.

 

Top contributing authors

Name
Posts
DevCoach
2
user's latest post:
OO Design Question
Published (2009-11-05 03:24:00)
IMHO inheritance is often overused by people new to OO design. In this sort of situation delegation is often better. I would have a separate PaymentPolicy class that the Project class can have as an attribute. This would then be subclassed into FixedPricePolicy and PayAsYouGoPolicy (and maybe others in the future). This class heirarchy would handle anything to do with payment. This has several advantages: 1) it solves your creation problem 2)...
JulianRead101
2
user's latest post:
OO Design Question
Published (2009-11-05 04:04:00)
Thanks for the reply, that makes a lot of sense. I will look into implementing it now.

Related threads on "Dev Shed Forums - Open Source web development":

Related threads on other sites:

Thread profile page for "OO Design Question" on http://www.devshed.com. This report page is a snippet summary view from a single thread "OO Design Question", located on the Message Board at http://www.devshed.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity