replaces the awkward
collaborator which we actually ship.
In a statically typed language, this means they must have the same type
Therefore only two relationships are possible between
|Fake Derives From Awkward||Shared Interface|
Of these, the relationship on the left is the most prevalent in strongly-typed languages.
It involves a slight risk:
's methods could be renamed while
's wouldn't, and then
would be useless. Proper tools and care should help mitigate this risk.
Rarely, there is a third possible relationship, where
has a usable, bare-bones base class that we can use (rather than creating a fake).
But strictly speaking, that base class isn't a fake.
||use this markup:
(Supported languages: java, cpp, csharp, c, python.)
|a method or class name