About js of encapsulation, inheritance, polymorphism some of understanding (personal understanding)

Package

When you need to hide some of the properties and methods that these properties and methods that can be packaged to specific interface and then through an external callable (can also be said to be a common method) invoked
personal understanding
is that the variable properties and methods all hidden in a function which, when you need to use it to call functions on Ok;

inherit

When there is actually inherited the same properties and methods more methods that put these same properties and methods to extract a common approach in
personal understanding of
some of the function call is to the parent element which you need,
in fact, some of your father also, this is probably inherited

Polymorphism (purely personal understanding)

Inheritance and polymorphism can be said to be two different aspects of the same thing, it is to inherit his father and some you have, polymorphism is not the father you have, and you generate genetic variation (inheritance) in the process of property

Released eight original articles · won praise 3 · Views 2732

Guess you like

Origin blog.csdn.net/weixin_46067435/article/details/104213037