Prev: pcnetsecurity@gmail.comAssistência Técnica manutenção de computadores informatica Vitória-es 13282
Next: Call for Papers: FCS'10 (The 2010 International Conference on Foundations of Computer Science), USA, July 2010
From: Daniel T. on 26 Feb 2010 13:42 On Feb 15, 10:40 am, Alexander <alexanderpaterso...(a)yahoo.fr> wrote: > > I've got a few really novice questions (actually I'm quite confused): > > - does implementation exist at the OOD level or only at the OOP level? > (I think it only exists at the OOP level) If I understand the question, you are correct. I call the OOP level the "implementation" level. > - does MI exist at the OOD level? (I think it does) Multiple interface inheritance exists at the OOD level, but I don't think multiple implementation inheritance exists at the OOD level. Implementation inheritance is a construct that some languages use to implement certain design concepts, it isn't a design concept in and of itself. > - if MI can exist at the OOD level, can such a design be trivially > translated to an OOP language that only supports multiple subtyping > inheritance? (like Java or Objective-C if I understand these > correctly) All of the languages I know about support multiple interface inheritance. > (I think any OOD can be trivially translated even to an 'ugly' hybrid > language like Java using only Java interfaces --hence only subtyping > inheritance-- and delegation). > > The source of my confusion comes from the fact that I'm always trying > to think "abstractions" and that, to me, "pieces of code" and "code > reuse" are really just an implementation detail. > > Is a subtype hierarchy inheritance or not? I think there is some confusion over implementation details bleeding into the design for you. I will present an example in C++: class ImplA { }; class ImplB : private ImplA { }; How do you think the above would look at the design level? [ImplB]<>--->[ImplA] At the design level, implementation inheritance looks like containment. Of course you know what interface inheritance looks like at the design level, so what if you have both? What does that look like? It would be a combination of the two. > Most people consider that Java and Objective-C do not support MI > because they do not support multiple subtype+subclass inheritance but > still they do both support multiple subtype inheritance and to me > coupled with delegation this is really MI. Also, Objective-C is dynamic typed, so interface inheritance isn't even an issue at the implementation level. |