. Net introduction to interface-Oriented Programming

Source: Internet
Author: User

The process-based development has gradually exited the eyes of the masses, followed by a variety of highly abstract development models; we have to admit that when there is no design model, it is difficult for us to summarize valuable development models to facilitate reuse and promotion in the future. The popularity of object-oriented technology allows our developers to look at software models from a new starting point, abstract is a good thing, but it also brings confusion to beginners. We can think of everything in the software as a simple encapsulation. We only need to call it, as a result, more and more developers began to gradually "float" [Wang qingpei is copyrighted. for reprinting, please give a signature]. People with certain programming experience and feelings will be given, I can understand what I call "float". It can be a wake-up question for beginners;

1:

2:

We have three layers of computer system abstraction layer, and the development at the application layer is basically at the top. Why should I give this picture, in fact, when our software system is constantly abstracted, we will be farther and farther away from the system layer:

The system layer will be gradually improved, and we will gradually be eliminated. The truth is that everyone can understand it. Therefore, we cannot always stay at the application layer. We need to enter the system layer, architecture design, system design, and so on are part of the work scope of the system layer. We have to enter the system layer to avoid a sense of crisis. Below we enterArticleTopic: Brief Introduction to interface-oriented programming; [All rights reserved by Wang qingpei. For reprint, please give a signature]

If you are interested in this article. for more information about the net interface, see my article ". net brief interface "; in fact, interface-oriented programming is a big topic, I am afraid that writing is not good, causing everyone to get angry and waste everyone's time, I plan to present the essence of interface-oriented programming in a simple way for a long time before and after. Let's use examples in real life as a metaphor (all object-oriented rules come from nature) [Wang qingpei has all rights reserved. For details, please give a signature.] I am a construction engineer. I want to develop a villa. As a construction engineer, I must first design the overall project, the result is a perfect building drawing. Please note that the building drawing is a big interface here. The idea of interface-oriented programming is that it does not involve specific implementation, only the hard conditions that must be met are given. As a construction engineer, he knows the details of each building and needs to be checked layer by layer. We begin to deepen the process. After a large drawing is made, it is implemented by the contractor, that is, it starts to be built. Here is the specific implementation. The implementation must be carried out in full accordance with the drawings, therefore, the relationship between the drawing and implementation is the relationship between the interface and the instance;

First, we should lay the foundation, and the drawings clearly define what structure should be used to support the foundation. Therefore, our specific implementation should be completely inherited from this interface. How to support it is the work of the engineering team? Let's continue to look at it, what we need to achieve is that the basic structure of the house, the shape of the house, the area of the house, the quality standard of the House, and other conditions have been provided in the engineering drawings, we only need to inherit from the house implementation interface to implement it. We are developing quickly. Now we have the specific door and window assembly, and the door and window interface has already specified what kind of decoration my door should have, what anti-theft measures are there; these hard conditions are specified in the interface; the specific door you use, the door of the manufacturer, and the color of the door can be as long as I have no rules; seeCodeFigure:

3:

Is to compare the interface in the project to the implementation conditions specified by the drawing, and the interface is the abstract representation of the drawing; please continue to see the code diagram:

4:

5:

6:

7:

Figure 7 shows the overall drawing. How can we develop it;

8:

9:

Conclusion: interface-oriented programming is probably just a bit of a piece. In the final words, interface-oriented programming is to promote the relationship between classes to a higher abstract level;

Interface-oriented programming is a kind of realm. I am just an introduction here, hoping to help you;

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.