The idea of "universal interface (non-generic interface)" thought by interface-oriented thinking

Source: Internet
Author: User

interface-oriented thinking

Since we've been in touch with object-oriented programming, with the continuous learning, will gradually understand the meaning of interface, interface programming emphasis on "definition" and "implementation" of the separation, I think its essence is "decoupling two objects of dependency", most often listen to people talking about must be " rely on inverted principle " The two classic words:

High-level modules should not rely on the underlying modules, both of which should rely on abstract abstractions that are not dependent on detail, and detail dependent on abstraction

Do not know how you feel, anyway, as long as the reference to the interface of these two words I often listen. Although the short two sentences, but are summarized in practice, is a software design must adhere to one of the principles, otherwise, once the demand changes your system may face large-scale rewriting, to meet the changing needs, I am afraid you will collapse. On the interface-oriented detailed knowledge of their own Baidu, here is no longer to repeat.

"Pan-Interface" idea

Saying that some time ago a company has been saying that the pan-security, that can not only be limited to the safety of anti-virus software, to promote the entire industry. I think this concept is very thoughtful, break through the traditional security sublimation to a higher level. So what is a "generic interface", I think it is different from the general sense of the interface to the specific implementation, it is a thought that rises to the design level, and the essence of the common interface is "decoupling" or "free interworking", embodied in the Code implementation level, such as various design patterns, spring and so on, Decoupling the dependencies between objects, otherwise, it will seriously reduce the maintainability and expansibility of the system; In the database level, for example, using the intermediate table (or mapping table) to decouple the table from the Many-to-many relationship, otherwise the table information and table relations are seriously blended together, resulting in a large number of data redundancy On ORM, such as using a configuration file to decouple the corresponding relationship between the object and the database table (or in the form of annotations). And the routing mechanism between the URL and the action in MVC, and so on and so on and so on, there are many more examples of such scenarios, and we find that the two "objects" involved in the above scenario are mutually exclusive, because they have a way of converting one side flexibly to another because of the decoupling "or" free interoperability "is used in every place, so it is abstracted, and the idea of" pan interface "is obtained. I'm afraid you are still foggy, what is it exactly ah, well, on the map (this picture is not necessarily reasonable, their own blind painting, you will do to see it, haha):

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/project/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.