Design of packaging

xiaoxiao2021-03-06  95

Xu Jing

2004-7-8

---- The concept of packaging is often encountered during the software development process, which seems to be empty, no accurate definition, and the points involved in different articles are different. In fact, there are two levels of packages for big aspects: 1. Technical packaging 2. Business (also known as software function) package.

---- Let's talk about technology packages: It is the most common, always put some implementation details into a function in order to achieve a specific technical issue. For example: a small function that is often used in the database program is to put a record of a field of the database table in the drop-down box, put the abbreviated field of the company table in a drop-down box,

For this simple feature, you can package it in a small function. Just tell this function. Several conditions can be 1. From that table to extract data 2. The field name in the table is 3. Which pull-down The control is displayed in the control, so you can define this function getcombolvalue (String Tablename, String FieldName, ComboBox Cboname).

---- However, the function is only a simple package for common technical movements. It does not involve application, it seems that a simple tool is done there, and uses these tools to build a large system There will be a cumbersome problem. For example, there is now a system: a total of 5 modules, each module is imported into purchase data, and if the writing function is written for each module, it can be considering the "business" of the imported purchase data, this layer. The package is a high level than the technical package mentioned, this level is the combination of various functions in the technology package.

Independent functional blocks.

---- Now a separate function block has been implemented, but it will encounter such problems. If the system is divided into 8 modules for procurement, inventory, financial, etc., the function blocks will become very dazzling, this time you need to organize these small function blocks according to the module. Such a preliminary business package is formed. For example, you can encapsulate individual and procurement operations in the class PURCHASE, one of which imports procurement data can be used as a method of purchase (subunies). This structure is clear.

---- There are many principles in the design of the package, the most basic principle is the independence of the function,

The implementation of a separate sub-function can only be achieved once. For example: there will be a global connection string in the database program. The patchwork of this string involves specific databases, different database formats, only need to put it in a function, you can implement it. There is no need to put it up again when you use it.

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

New Post(0)