You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- God object?gnat– gnat2017-01-22 18:19:27 +00:00Commented Jan 22, 2017 at 18:19
- 1@gardenhead has a good answer. Also see en.wikipedia.org/wiki/Subtyping. Polymorphism in OOP is often referred to as inclusion polymorphism in broader contexts, because there are also other kinds of polymorphism.Erik Eidt– Erik Eidt2017-01-23 06:28:39 +00:00Commented Jan 23, 2017 at 6:28
- 2What you have there is often referred to as multiple inheritance (multiple interface inheritance in Java and C# as they don't have full multiple inheritance, I have not seem many languages that do full multiple inheritance properly). Polymorphism usually refers to multiple implementations inheriting from a single interface, to that one implementation can stand in for another.ctrl-alt-delor– ctrl-alt-delor2017-01-23 23:17:18 +00:00Commented Jan 23, 2017 at 23:17
- That's what my interviewer said about inheritance, but I didn't agree much with him, because what is missing here is the behaviour/implementation inheritance, unlike C++. I reviewed the Gamma et. all introductory chapter of their book and I believe the whole point is, like you said, the ability to substitute an object to another, so the clients don't depend on a particular object, but on interfaces. Interface in Gamma is different from the interface from C# or Java. Gamma considers the object's interface the totatity of its public methods. A type is a name to denote a particular interface.Adrian Iftode– Adrian Iftode2017-01-24 07:27:03 +00:00Commented Jan 24, 2017 at 7:27
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you