Learning components:

xiaoxiao2021-03-06  40

First, you should first understand the commonly used component type.

Of course, these types are not strict, most components have two functions, no strict boundaries

Such as Spring, Structs, Hibernate, but Spring focuses on the configuration, so the code maintained by its development is convenient, the transplantability is good, but the components of the access database (can be used alone), the user can directly transfer directly in the class Development.

Injectable component

1, in this way, the programmer can drive to the component method in the class you write. The method of writing the program is to inherit a class in the component, call its related methods, get it returned, then process this Value, this is an injection writing method

It is often called the application of this thing as a heavyweight component.

The role of components play in this way is similar to the role of help, like Helper class.

Drive by the class written by the user.

Configuring components

2, this way mainly uses Java's REFLECT mechanism. In this way, the programmer does not see the traces of the calling component. The programmer is complete (these functions are commonly used, or When the component is defined, the programmer is only implemented by the functionality), and then in the configuration file (one or several XML files) provided, the configuration is configured, and then the component is driven by the component.

转载请注明原文地址:https://www.9cbs.com/read-75173.html

New Post(0)