Usually I do not want to know the nuances of OP's Oppo, but when I got an argument in an interview I recently ran At the time I had posted a question I had told a loss of (OOP), I considered OP to be the most mature level of programming after the procedural and functional model. So I replied to him that I do not see any negative.
But the interviewer said that there are few, and I told him that if he does not talk, list him. He has given an example that I have not digested well, he said that an OOP pattern does not strictly enforce the rules of inheritance and the satellite / rocket example is referred to where the rocket launches the body for weight loss Part will be scattered from time to time and it will be said that the heritage does not support it.
Their example was due to the application of heritage for such an example, I was feeling very strange
I understand that in the case for which he had given it hardly There was a meaning, but I suspected this -
Can we dynamically unplug the class hierarchy (I believe Java is not possible in an ideal object oriented design?
I'm not perfect Understanding his example from the living.
However, it is important to understand that OOP is very effective for things that can be modeled naturally with it, and other things (such as crosscutting concerns or Aspects), it is a disadvantage of OOP. Another is that due to dynamic dispatching it often falls into some runtime cost.
In addition to this, It is easy to abuse OOP, it is an example of taking a rocket heir from the body. My experience is that novice developers either do not trust or use inheritance, or they are more curious and use it incorrectly. , When other behaviors (such as aggregates) are more appropriate. Over time, improving the experience and understanding of the mechanism.
I am not sure that the purpose of "OOP pattern is not strictly enforced by the rules of inheritance", because OOP is not a pattern. One potential problem is that there can be a subtype that can violate the principle of the replacement of the transcript, so that the overriding method does not behave "at least" like the overriding method, to check for it automatically There is no way, therefore it is possible to write code violating OP principles.
For your last question, "Can we unplug the class hierarchy in an ideal object-oriented design?", I'm not sure what you are saying here. If you are asking about changing the hierarchy on the runtime, and to create it, so that there is no subtype connection from some point in the execution, then yes it is possible that some languages like Smalltak. Some argue that this is "more OOP" in small things, the methods supported by one type are determined on the basis of current class, depending on the current content of each class on the point of call. When I love small tones, it's a specialty that I am not mad about it, because I check the compilation time with fewer runtime surprises.
Comments
Post a Comment