The interface is described with the component interface to describe the service provided by the component. Interacting between components and components, components and customers are interacting through an interface. Therefore, once the component is released, it can only provide reasonable, consistent service by pre-defined interfaces. The stability between this interface definition allows the customer to apply developers to construct a rugged application. A component can implement multiple component interfaces, and a particular component interface can also be implemented by multiple components.
The component interface must be self-description. This means that the component interface should not depend on the specific implementation, and the implementation and interface isolation completely eliminates the coupling relationship between the user and the implementation of the interface, enhances the level of information. At the same time, this also requires the component interface to use a language that is unrelated to the component. The description criterion of the current component interface is the IDL language.
Since the interface is the protocol between components, once the interface of the assembly is released, the component producers should keep the interface as constant as possible, any changes to interface grammar or semantic changes, can cause existing components and customers. The relationship is destroyed.
Each component is autonomous, with its unique features, can only communicate with external interfaces. When a component needs to provide a new service, you can implement it by adding a new interface. Will not affect the customer already existing in the original interface. And new customers can reselect new interfaces to get services.
Componentization programming
Componentized programming methods inherit and developed object-oriented programming methods. It applies object technology to the system design, making further abstractions for the implementation of the programming of the object. We can use the components to design the components as a method of constructing the system's architecture level, and the components can be easily implemented using object-oriented methods.
Component programming emphasizes the true software reusability and height interoperability. It focuses on the generation and assembly of the components, which together constitute the core of the component manufacturing program design. The process of components is not only the needs of the application system, but the component market itself has also promoted the development of components and promoted the exchange and cooperation of software vendors. The assembly assembly allows the software product to rapidly establish a method similar to a wood, which can not only shorten the development cycle of software products, but also improve the stability and reliability of the system.
The method of component programming has the following features:
1. Programming language and independence of the development environment;
2. Transparency of the component position;
3, the process transparency of the component;
4, expandability;
5, reusability;
6, with strong infrastructure;
7. Public services at the system level;
C # language is very suitable for component programming due to its many advantages. But this is not to say that C # is a component programming language, nor does it say that C # provides components programming tools. We have repeatedly pointed out that components should have characteristics that are independent of programming language. Readers should remember this: Component model is a norm, no matter what program language design component, this specification must be observed. For example, an example of assembling a computer, as long as the various manufacturers provide us with the accessories specifications, the interface meets the unified standards, these accessories can be combined to work together, and the component programming is the same. We just say that the component programming will bring us more convenient to use the C # language.
I know what is the interface, and then how to define the interface, please see the next section - define the interface.