Re: Problem of inheritance

Originally Posted by
lanz
Could you please elaborate on that? I use similar approach sometimes and it would be good to hear about downsides.
by changing inheritance for composition the overall design hasn't changed, just the implementation. It appears that the two concrete classes still cannot do a job by themselves, and still require each other to do a job.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Bookmarks