Self-built toolset development document ------ preamble (1.0.0.1)

zhaozj2021-02-16  58

Self-built toolset development document ------ preamble (1.0.0.1)

version number

founder

Create time

Note

1.0.0.1 Musi Road 2003-12-19 Draft

Keywords: C #, tool set, preamble

text:

At work, several systems come down, there are many duplicated work, such as database operations, error handling, logs, etc., so I intend to write a universal tool class library so that they can be reused in future systems; At the same time, it is also to study C #, now put the development process, develop ideas, source code, etc., the main purpose is to get some criticism and advice, and hope that I can have a little benefit of learning C #. I hope that after reading, I can give me some suggestions. I sincerely hope that everyone can help me, thank you again. If you have a friend who needs to get the source code, please send me an email: 191471650@qq.com, my QQ number: 191471650, I hope to be friends with everyone, learn and work together.

Design ideas:

In order to reach multiplexing, the part of all systems is extracted, and the business is not related, there are some ideas:

1. The tool set involves the underlying system of the system, the internal division is clear, reducing the degree of coupling between the hierarchies, increasing the internal gathering of the hierarchy.

2. Try to design the pattern design idea to design.

3. Give a system configuration file SystemConfig.xml, store some and the system-related static data, so that the reuse and configuration of the tool.

4. Try to use an XML file to store the data to be used, such as: Error Description, SQL statement, etc., which can reduce the compilation burden of certain modifications.

overall plan:

This class includes the following modules: database operation, log processing, exception handling, where database operations include: Database connection pool implementation, SQL language automatically generated, database execution. Abnormal processing is the lowest layer, and the exception handling class is called when the database operation and log processing are implemented.

Goals:

database:

1. A common interface, configurable to use different data sources and write corresponding implementations for different data sources, hide all implementation details, which can migrate the data from the database to the text file without Impact the business layer;

2. A connection pool, automatically maintain the connection in the connection pool;

3. Dynamically realize the generation of SQL statements such as insert, update, delete;

4. Implement a simple query SQL statement automatic generation, including: single table query, table connection query, simple aggregate query;

5. Package database query, update, insert, delete, stored procedure, etc.

abnormal:

1. Use custom abnormal messages to give user prompts and exception information.

2. Simplify the complexity of the abnormal class call as much as possible.

3. Exactly locate an abnormal position.

Log:

Record log information;

2. Try to achieve the classification of the log for inquiries and statistics for logs;

3. Tracking a log of an object.

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

New Post(0)