Relational relationship

xiaoxiao2021-03-06  41

The successful implementation of the cut-off relationship is successfully implemented in the recent project. It feels good.

Example 1

The application system is dependent on the lower layer.

Background: Application system requires the lower-level driver, and customers also want to see the apparent look of the system. And this application will rely on several kinds of drivers, while driving is still developing.

Implementation: The driven API is set, and the simulation of these drives as soon as possible. For example: file system, configuration system, I / O simulation data, data of RS232 communication. I found a typical application process and record all the relevant data. Then start analog-driven data returns.

RESULTS: Although it took a few days to do an analog drive system, the application system was still made in the customer's time. Customers have also seen a system that can run. Some stable drives are hung, and unstable drivers use analog systems. The simulation system will evolve into a driven test system.

Example 2

Application system on dynamic configuration

Background: a small application container, dependent 2 encenration XML file. The application container is also the first contact, and the 2-based XML file resolution is also the first contact. The key to the container is to analyze clear dynamic models, and 2 progress parsing is primarily a program and data structure. Project time is very tight. It is impossible to wait for the study to start again.

Implementation: The structure of the generated object after design is designed. Ensure that the application container is only accessible by the interface. 2 Billing XML file resolution guarantee generated object. A project is broken down into two subprojects. If someone can start at the same time.

RESULTS: The implementation of the application container is established on the simulated parsing object through the factory method, and the application system starts step by step. After the main technical issues of the application system are resolved, they will focus on the analysis of the XML file. Soon started. Although there is no merger now, since the interface is unified, the merger has no problem in theory. (I have merged success, basically there is no special issue)

Implement the line: Partial implementation of the application of the container -> 2 Partial resolution of the credit -> All parsing ---> Application container all implementations.

DIP (Interface Upset Principle) is very important. The application system should define the underlying service requirements as much as possible, and the simulation layer (possibly called Mock Object) in the middle of the implementation is generally beneficial to system development. The application system can test in advance, after all, the application system is more complicated than the lower-level business logic.

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

New Post(0)