Cost Value of object-oriented Encapsulation
This chapter implements custom encapsulation for some representative data controls. Its content is informative and precise enough, and some controls are also encapsulated, such:
• Custom "tabcontrol" to "TC _" class;
• Custom "RichTextBox" to "RTB _" classes.
Because they do not have many characteristics worth emphasizing in requirement grasp and design conception, they will not be listed one by one. As long as you grasp the general concepts and implementation methods of custom encapsulation, You can implement custom encapsulation for some necessary propositions at any time when necessary.
The encapsulation of the operation logic is beneficial to comprehensively improve the operator's evaluation of the system. This is a basic positive result. In fact, the purpose of implementing control encapsulation in operation logic is only a small level. This encapsulation serves to lay the foundation for encapsulation of containers, forms, and business models, it will play an important role in the construction process of the application system, which will be gradually seen in subsequent chapters.
For experienced project management personnel or system designers, control-level encapsulation is generally used as the preliminary work of system development and preparation before the start of User Function Design. This can be understood only after understanding the meaning of Data Control encapsulation. The functionality and system of the basic control encapsulation will greatly affect the subsequent development workload and play a role throughout the project life cycle. Without the conception and encapsulation of basic controls, many highly automated functions will be difficult to implement.
No one defines that you must encapsulate those controls, but as long as you want to follow the object-oriented design philosophy, this is a natural design program. In many project processes, policy makers are reluctant to face the cost (economic cost and time cost) consumed by the encapsulation of basic controls. In fact, this is a misunderstanding. encapsulation will consume a lot of cost in the early stage, however, the efficiency will be greatly improved in the later design process. This is one of them; the reuse value of encapsulation will exist for a long time, and this is the second. For more evaluation factors, see the impact of encapsulation on the testing workload (an important component of the cost component. After the basic controls are encapsulated, at least 50% of the test workload can be reduced, or even 80%. Now let's evaluate the significance of the basic control encapsulation. I'm afraid it will change.
The reason why "Object-Oriented" can become the design philosophy shared by various development languages is that "object" can become the objective carrier of the design objectives, encapsulation is to establish the specific relationship between the "object" and the design goal. If you discard the encapsulation of basic controls when using object-oriented development tools, you will lose the soul of the object-oriented concept, so you will not be able to get the expected benefits in the development process.
The original design is generally an entry-level process. Based on the complexity of the application, it is difficult to perfect the one-time original design. Many people have thought about how to solve this problem when they have time ". But with the passage of time, this kind of flashing idea will be overwhelmed. In fact, this process of re-understanding the original design connotation is an effective way to rapidly improve programming capabilities. Only by constantly reflecting on it can we find the internal laws of transactions from it, in order to finally obtain a general design model. It is not about the size or importance of the problem. As long as you practice and persevere, you can accumulate more and more resources, and your abilities and levels will naturally increase rapidly.
Tip: even if you are not using the. NET development environment, the requirement analysis, scenario analysis, and operation logic implementation here will still be of practical significance, because these are all factors irrelevant to the language environment. Since the same is an object-oriented design concept, these objective Implementation ideas have practical significance in any object-oriented environment, and even the reference value remains unchanged in the Web mode.