Christian Heupel wrote:
The main issue I'm having with this is that both the "sender" and "receiver" inherit from the same (abstract) parent. When I want to use composition for a class that represents "both functionalities", I am forced to create redundant code. As an Example:
If you want to use composition to create a "MultipicationAndDivisionCalculator", you will have to implement "add" and "subtract" two times, one of which will never be used.
Christian Heupel wrote:I would need a Calculator for every SuperType possible then...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Christian Heupel wrote:Don't forget that I am using generics in my original example.
I’ve done that. It might make it worse, since the original code mixes tabs and spaces
Winston Gutkowski wrote: . . . PS: If you could break up some those enormous lines in your code, it would make everything a lot easier to read. Thanks.
What a show! What atmosphere! What fun! What a tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!https://www.kickstarter.com/projects/paulwheaton/low-tech