The cost value of object-oriented encapsulation

Source: Internet
Author: User

This chapter implements a custom encapsulation for some representative data controls that are sufficiently detailed and sophisticated, as well as some of the controls being encapsulated, such as:

• Custom "TabControl" to "Tc_" class;

• Customize "RichTextBox" to "Rtb_" class.

Because they do not have much to emphasize on the need to grasp and design ideas, so they are no longer listed. As long as you grasp the general concept and implementation of the custom package, you can at any time when necessary to implement a custom encapsulation of the necessary propositions.

The encapsulation of operational logic is beneficial to the overall improvement of the operator's evaluation of the system, which is a basic and definite result. In fact, we implement control encapsulation from the operational logic as a shallow level, and the deeper meaning of this encapsulation is to lay the groundwork for encapsulation of containers, forms, and business models, which will play an important role in the construction of the application system, as we will see in subsequent chapters.

For experienced project managers or system designers, the control-level encapsulation is generally used as the prophase work of system development, and is the preparatory work before the user function design begins. This can only be understood when you understand the meaning of the Data control encapsulation. The functionality, and the system, of the underlying control encapsulation will significantly affect the workload of subsequent development and play a role throughout the life cycle of the project. Without the idea and encapsulation of the underlying control, there are many highly automated features that are hard to implement later.

No one has to stipulate that you have to encapsulate those controls, but as long as you want to follow the object-oriented design concept, this is a custom into a natural design program. In many projects, decision makers are unwilling to face the cost of the underlying control encapsulation (economic and time costs), in fact, this is a misunderstanding, encapsulation will consume a lot of cost in the early stage, but in the later design process will greatly improve efficiency, which is one; the reuse value of encapsulation will exist for a long time, this is the second. If more evaluation factors are required, you can refer to the impact of encapsulation on the test workload (an important component of the cost component). After the underlying control encapsulates, at least 50% of the test effort is reduced, or even up to 80%. Again, the meaning of the underlying control package is evaluated, and I'm afraid it will change.

"Object-oriented" can become a variety of development language to follow the design concept, is because "object" can become the objective carrier of design objectives, encapsulation is to establish "object" and design goals of the specific relationship. If you discard the encapsulation of the underlying control when using object-oriented development tools, you lose the soul of the object-oriented idea, so you can't get the benefits you deserve in the development process.

The original design is generally an introductory process, based on the complexity of application, one-time original design is generally difficult to achieve perfection. Many people in the process have thought of "when there is time to solve this problem again." But as time went on, the idea of the flash had been wiped out. In fact, the process of understanding the original design connotation is an effective way to improve the programming ability rapidly, only by constantly reconsidering, can we seek the inner law of the business and finally get the design model with generality. is not the size or importance of the problem, as long as the practice and can persevere, the accumulation will be more and more, the ability and level will naturally rise rapidly.

Tip: Even if you're not using the. NET development environment, the requirements analysis, scenario analysis, and operational logic implementations will still be practical, because these are all factors that are not related to the language environment. Since the same is the object-oriented design concept, these objective realization of the concept in any object-oriented environment has practical significance, even in the Web mode still without losing its reference value.

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.