Jsplet and IOC

xiaoxiao2021-03-06  23

About the management of the Object life cycle in jsplet and using the pull mode, if the currently popular design terminology is used, that is, the so-called IOC design (control reversal)

The IOC's Container is now very sought after, but the real IOC design thoughts do not have attracted everyone. Perhaps most people are using finished products, so that the functionality of the finished product is equivalent to the design principle they rely on. Spring, etc. The IOC is more accurately deformed by Dependency Injection, just an embodiment of IOC. Its basic idea is an object does not control all parts related to it, but the control of the person to use the object. It is important to control the reversal of the control flow (information flow).

The management of the object life cycle is also the case, not by a Manager speculate that the user uses the object, but directly indicates his attitude directly, directly issues an instruction.

Refer to the resource control method in desktop applications, we open a window, interact with the system, accounting for resources, shut down the window, then the resource occupied by the window and its sub-window is released. Similar to the object control policy in the jsplet. When the user exits from a certain row, it is started to make a resource cleanup when the user has given the current ObjectScope when the user accesses the object. That is, the user's behavior and intentions directly drive the system's object management. Of course, if the user has never sent a call, then the system can only guess the behavior of the user, is the user has been disconnected or thinking? In this case, if resources are controlled, you need to add a function similar to EJB through AOP.

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

New Post(0)