[fpc-pascal] Implementing Factory Method with Pascal
md at delfire.net
Sun Nov 29 03:20:42 CET 2015
On Sat, Nov 28, 2015 at 3:31 PM, Marco van de Voort <marcov at stack.nl> wrote:
> In our previous episode, Marcos Douglas said:
>> Inheritance breaks encapsulation. This was written even in GoF Patterns.
>> There are many post, on the web, explaining why inheritance is evil.
>> I searched on Google right now:
> Such rants are in direct opposition of GoF. GoF never meant to push a set of
> unbendable rules. They just wanted to standarize jargon, and describe
> somethings they encountered (without any claim that everybody should use
I only chose two links to put into the email. There are many other ...
I just pointed some examples because they have examples.
In my GoF book (Portuguese version), page 34, says:
...It is often said that "inheritance violates encapsulation"...
"Preferably the object composition instead of class inheritance."
> Aside from the fact that interfaces is still inheritance.
This is different. There is no behavior, only a contract.
More information about the fpc-pascal