How to deploy the interface and business logic in a program.

Source: Internet
Author: User

The software interface is actually the interface between the software and the user. The main responsibility is 1. display, 2. Get the user input.

Each software has its own business logic.CodeAnd how to deploy the interface implementation code is a problem, because the deployment is good, it determines whether the code is clear.

We recommend that you separate the business logic code from the interface code. We use objects to organize ourProgramWe divide the software into interface objects and Business Objects. First, we implement them separately, and finally define interfaces to implement simple communication between business objects and interface objects. Then we can interact with each other.

There are two main aspects of interaction between business objects and interface objects: 1. How to display business information, 2. How to handle user operations.

The display information is to draw a chart or print text information. this can be achieved through two methods. one is derived from a standard interface control to draw business information. the second step is to enable the standard control to develop a drawing interface, and then display the information of a Specific Drawing Object for business development.

So here is a little bit. when developing standard controls, you only need to define the display format, such as a list, such as a graph. however, the source of information should be open. for the list, you can also open the drawing of each unit. When you place this standard control in a specific application environment, developers can derive or provide a plotting interface to display specific business information.

For user operation processing, we recommend that you use window messages, such as wm_notify. By default, messages are sent to the parent window. You can set a control window to receive messages.

The interface object is separated from the business object. The advantage is that the logic is clear, the code reuse rate is high, and the debugging of each department is convenient.





Related Article

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: 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.