Java: What is API-oriented programming?

Source: Internet
Author: User
In an object-oriented system, various functions of the system are completed by collaboration of many different objects. In this case, it is not that important for system designers to implement their own internal objects. The collaboration relationship between objects becomes the key to system design. Communication between different classes and interaction between modules should be considered at the beginning of system design, which is also the main work of system design. Interface-oriented programming I think it refers to programming according to this idea! In fact, in daily work, you have already programmed according to the interface, but if you do not have the consciousness in this aspect, you are only passively implementing this idea; it is manifested in frequent complaints that the Code modified by others has affected you (the interface is not designed), and the changes in a module have caused large-scale adjustments to other modules (the module interface is not well designed) and so on.

Mr. booch talked about interaction designer that day. It refers to people who do this kind of design, but with a higher level. I think this type of people in our software design team is one of the most lacking talents.
Non-interface programming? Is it a process-oriented programming idea?

1. Understanding about interfaces.
The deeper understanding of interfaces should be the separation of definitions (Norms, constraints) and implementations (the principle of separation of real names.
Generally, when implementing a system, we usually integrate the definition and implementation without separation. In my opinion, the most understandable system design specification should be the separation of all definitions and implementations, although this may be a little complicated for some situations in the system.
The interface itself reflects the abstract understanding of the system by the system designer.
There are two types of interfaces: the first class is the abstraction of an individual, which can correspond to an abstract class );
The second type is an abstraction of an individual, that is, an abstraction interface );
An individual may have multiple abstract faces.
There is a difference between an abstract body and an abstract surface.

2. Another factor that cannot be ignored when designing an interface is the context (Environment) of the interface. the viewpoint of system theory is that the environment is the sum of the space and external influencing factors of the system elements. Any interface is generated in a certain environment. Therefore, the impact of environment definition and environment changes on interfaces cannot be ignored. From the original environment, all interfaces will lose their original meaning.

3. According to the component development model (3C), the three components complement each other, and each other is integrated.

Object-oriented means that when we consider the problem, we take the object as the unit and consider its attributes and methods.
Process orientation refers to the implementation of a specific process (transaction process) when we consider the problem.
Interface Design and non-interface design are aimed at reusing technology, which is not a problem with object-oriented (process ).

In my opinion, the interface mentioned in UML is another protocol. It does not refer to com interfaces, CORBA interfaces, Java interfaces, Delphi interfaces, man-machine interfaces, or Nic interfaces.

In specific implementation, the UML interface can be implemented as a language interface, an interface in a distributed object environment, or any other interface, but in terms of understanding the UML interface, the implementation of each part of the system works together through the Protocol defined by the interface.

Therefore, in my opinion, interface-oriented programming is intended to be oriented to abstract protocol programming. The implementers must strictly follow the protocol to implement it. That is, what Comrade Bill Joy said about writing code while reading the RFC. Object-Oriented Programming refers to abstract-oriented and concrete-oriented. Abstract and concrete are the unity of contradictions. It is impossible to have only abstract without concrete. Generally, people who know the abstraction understand this truth. However, some people only know what it is, but do not know what it is.

Therefore, it is useless to implement only interfaces, or to implement interfaces without interfaces.

So it is still honestly object-oriented programming, protocol-oriented programming, or nothing, honestly programming.

But I hate to talk about such a term. Why do we talk about leader-oriented programming? User-oriented programming? Leaders and users are sometimes very BT, so we are oriented to BT programming?

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.