You are here: Re: Best Coding Practice « PHP Programming Language « IT news, forums, messages
Re: Best Coding Practice

Posted by Steve on 08/24/07 18:48

| Initially I was going to answer your post with a description about how
| Product classes are active records and FreeProducts aren't *really*
| active records. However, the more I thought about it, the more I
| realized that that's in fact no justification for a child class in
| this case. In fact, because of the way the Order class stores
| products, i.e. basically $products['product_id_number'] = $quantity,
| this would only add an extra layer of complexity and not really make
| storing the products any easier. This leads me back to what you and I
| originally concurred about being the better solution (or something
| like it, such as passing in an array, as you suggested, or denoting
| the appropriate array by product characteristics as per Toby).
| To others this may not sound optimal, but this system is rather large,
| and has become rather convoluted over time, and as such it's hard to
| describe the different factors I need to account for; I really do
| think that an OO approach would be overcomplicated in this case.

stop right there! statements like that are said by people that DON'T
understand OOP. they say it so frequently that all but seasoned developers
believe there is truth to it. that propogates MORE people give birth to
millions of lines of shitty code because they shy away from OOP and what it
REALLY offers.

it should be BECAUSE your system is becoming convoluted that you should use
OOP!!! otherwise, you'll end up with a monolith that will eventually topple.

 

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

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