I have long been thinking about writing a general underlying framework. After all, I usually do a lot of work and I am not satisfied with the project's adaptability by using a third-party framework, therefore, it is better to take the time to write a comfortable framework, so it took several months to complete the development of this project. Now I will introduce it to you, I believe this framework will be suitable for actual work needs and improve development efficiency. This seriesArticleWe will introduce the use of this project and these library files in eight parts.
The framework to be introduced in this series is called isline framework. You can call it "Einstein ". It is not an industry business architecture, but can be usedProgramStaff Development Project Kit, using this underlying suite development system, can simplifyCodeTo improve the code quality. The isline framework consists of seven modules: dataprovider, applogprovider, exceptionprocessprovider, httpcontentprovider, islineframework, securityprovider, and taskqueueprovider. There are 18 namespaces in total, the main methods of these providers and various class libraries and interfaces are managed respectively.
Table 1.1 namespace Name List
|
Isline. applog. datatypeenum
Isline. applog. Configuration
Isline. applog. applogprovider
|
Isline. Data. datatypeenum
Isline. Data
Isline. Data. containerdefiner
Isline. Data. dataprovider
Isline. Data. Configuration |
|
Isline. Security. Cryptography
Isline. Security. basefunction
|
Isline. exceptionprocess. datatypeenum
Isline. exceptionprocess. exceptionprocessprovider
Isline. exceptionprocess. Configuration |
|
Isline. httpcontent. hcdatatypeenum
Isline. httpcontent. httpcontentprovider |
Isline. ildatetime
Isline. Message. Mail
|
|
Isline. provider. dataprovider |
|
All external representations of the isline framework are in the form of providers. Each provider is divided into functions, enumeration, and configuration. Every provider is developed in accordance with this contract, and this is also the namespace division rule.
The "function" namespace indicates that the provider's subject completes the task. The "function" namespace includes interfaces, abstract classes, and implementation of these abstract elements. It is the main part of the provider.
The "enumeration" namespace indicates all data types used in the provider to interact with users.
The "configuration" namespace indicates the information that the provider needs to support in the configuration file. Before the provider runs, the system automatically loads the corresponding configuration file and loads the relevant nodes, provide the information in these nodes to the "function" module for processing.
Now let's briefly talk about the role of each provider.
1. dataprovider
Like other frameworks, dataprovider provides the ability for projects to interact with databases. The advantages of dataprovider are not described here. Here we only talk about the difference between dataprovider and the data access layer of other frameworks.
Dataprovider is compatible with both SQL Server and Oracle databases and provides the idboperater interface. You can provide instances for dataprovider as long as you implement the idboperater interface factory, so that you can use the third database, you do not need to modify the database call keywords. In addition, dataprovider provides two methods: static access and instance access.. Net container. You can select different methods and provide a unified dispose () method. You only need to call it once to close all readers; static calls do not need to release any resources. Static access and instantiated access are differentiated based on the connection-oriented and non-connection-oriented working methods.
Dataprovider also provides you with recordprovider, which allows you to conveniently operate. config files, text files, XML files, and so on.
Dataprovider comes with the data container option: containerdefiner. CS, using this type of instance, users can directly call various ADO objects, and the container caches, compresses, and optimizes some large data objects, these optimizations follow the "space-for-time" principle during storage and the "time-for-space" principle during transmission. The front-end business performance will be substantially improved!
2.Applogprovider
Applogprovider provides powerful logging functions for users. Users can provide separate configuration for each "log instance" in the program. Each configuration can have different "render ", each render indicates that different "appender" can be used. The appender determines the importance level, record media, record format, layout, and other attributes of the log instance. You can complete the configuration without changing any code. In other words, if your original system logs are all recorded in text files and you want to record the logs to SQL or Oracle databases, the only thing you need to do is to change the configuration, if you need to output logs to the TV, you need to implement the iapplogprovider interface distributed by applogprovider.
If you have used log4net, you will be familiar with applogprovider, but applogprovider provides more flexible configuration methods.
3.Predictionprocessprovider
Exceptionprocessprovider provides the exception control function, which consists of two modules: exception record and exception display.
The exception logging module is based on applogprovider. You can pass exception instances to record exceptions. At the same time, exceptionprocessprovider supports custom exception models, which can be created together with the entire software model, the entity exception model (must inherit from exception) is used to process events and realize the exceptionprocessprovider distributed interface to implement the exception record function. The exception display module refers to the notification information displayed to users when an exception occurs. These notifications are classified into 10 types in predictionprocessprovider, you can switch between the 10 styles only through configuration.
4.Httpcontentprovider
Httpcontentprovider provides users with Cookie, session, and cache access methods. Through configuration files, users can control the attributes of these statuses, such as Cookie scope and sliding time, cache dependency (only SQL Server. By using these methods, you can easily create, query, delete, and update these statuses.
5.Islineframework
Islineframework is the core of the overall isline architecture. Before the architecture is loaded, isline. dll configures the entire architecture to complete the customization task.
6.Securityprovider
Securityprovider provides users with encryption and decryption, strong encryption and decryption methods. These encryption measures provide a basis for the password in the encrypted configuration file.
7.Taskqueueprovider
Taskqueueprovider is a service queue that you can use to register an existing service. taskqueueprovider returns an instance for you to use based on the service node elements to build a "field" Model for enterprise applications.
In the next section, we will explain in detail how to access data.
This article has been published simultaneously in the software report and cannot be reproduced by any personal media.