How to deploy interface and business logic in the program.

zhaozj2021-02-16  76

The software interface is actually the interface between software and users. The main responsibility is 1. Display, 2. Get the user's input.

Each software has its own business logic. How to implement code and interface implementation code is a problem. Because the deployment is good, it determines whether the code is clear.

It is recommended to separate business logic code and interface code. We use objects to organize our programs. We divide the software into interface objects, business objects. First achieve, finalize the interface, implement business objects and interface objects, Interaction is ok.

The main two aspects between business objects and interface objects: 1. How to display business information, 2. How to handle users' operation.

The display information is to draw charts or print information. This can be implemented in two ways. One is derived from the standard interface control, drawing business information. The second is to develop a drawing interface for standard controls, and then draw specific business development dedicated Object is responsible for information display.

So this will be taken here. When developing standard controls, as long as the display format, such as a list, such as a graph, etc., but the source of information is to be open. For the list, you can also open each unit's drawing, when this standard When the control is placed in a specific application environment, developers can achieve the display of specific business information by deriving or providing drawing interfaces.

For user operation processing, it is recommended to implement a window message. For example, WM_Notify, etc. The default message is sent to the parent window, you can set a control window, which is specifically received.

Interface objects and business objects are separated, and the advantage is that the logic is clear, the code reuse is high. And it is convenient for individual departments to debug.

against

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

New Post(0)