|
Posted by Jerry Stuckle on 10/16/07 12:45
Oliver Grätz wrote:
> 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
>
Yes, I responded to you because I thought your response was not a good
way to do it, for the reasons I gave.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|