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

Posted by Oliver Grδtz on 10/16/07 03:29

Jerry Stuckle schrieb:
> Oliver GrΓ€tz wrote:
>> Jerry Stuckle schrieb:
>>> Oliver GrΓ€tz wrote:
>>>> $topping2 = new withExtraTopping($topping1);
>>>> $total = $topping2->getPrice();
>>>> print $total;
>>>>
>>>> Where's the problem, it's a simple decorator example.
>>>>
>>> Several things.
>>>
>>> What's the difference between an object of class withExtraTopping and
>>> $topping1?
>>>
>>> What is the price of $topping2? Every pizza place I know charges more
>>> for the same topping on a larger pizza.
>>>
>> Changing the concept is out of scope here. I simply ANSWERED the
>> question asked by the original poster. Changing the price of extra
>> toppings and making the price dependent on the pizza size was NOT part
>> of the question.
>>
>
> It is if you're emulating the real world.
>
> Initial requirements do not always reflect final needs.
>
Yes, but you were answering to MY RESPONSE and not to the original
poster. I just DIRECTLY answered the question. Other evangelizing
answers had already been given (and I didn't need to elaborate on them)
but I personally dislike the fact that these people tend to bring up
more questions INSTEAD OF solving the problem at hand. You can bring up
your own concept, fine. But please ANSWER THE QUESTION first. What
speaks against the idea that iavian just didn't get the concept of a
decorator? Nothing, since the code he already had was well capable of
solving the questions he asked without change!

OLLi

--
Never change a running system.

 

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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация