Thought interface

       Introduced in front of the code reflects the interface, the interface now introduce ideas, will be described below from life examples.

       For example: We all know that left a lot of jacks on the computer, which can be inserted into the appropriate socket device, why these devices can be inserted on top of it? The main reason is that these devices when produced in compliance with the rules of the use of socket, otherwise it will not be inserted into the interface, but can not be used. It found that the emergence of the socket so that we use more equipment.

      Summary: Interface benefit under development

  1. It extends the functionality of the interface appears.
  2. The interface is actually escaping violent rule.
  3. Reduced occurrence coupling interface, i.e. to achieve a decoupling between the device and the device.

 

       Interface appears easy to use and maintain the latter, one is using the interface (such as computers), a party in the implementation of the interface (the device inserted in the socket). For example: notebook to use this rule (Interface), computer peripherals implement this rule (interfaces).

 

Published 99 original articles · won praise 3 · Views 2246

Guess you like

Origin blog.csdn.net/weixin_41874888/article/details/103998787