in reply to Re^2: I dislike object-oriented programming in general
in thread I dislike object-oriented programming in general
In your example, it sounds like I probably would've used "aggregation", i.e. move the common operations to methods in a new class, where the original code needs to create a "calculator handler object" (or somesuch) to access them. The advantage is that the new code is much more independant of the existing code (it has real "encapsulation").
|
---|