I learned the design of the abstract database of the famous open source community CommunityServer (CS), thought independently, thought about the problem from a philosophical perspective, and further abstracted, and finally designed a very abstract universal database and universal data access layer.
The main advantages are:
1) Store any data entities and relationships between entities through two abstract tables;
2) The field expansion needs of any data entity are realized through two extended field design methods, and the extended fields support database-level sorting and search functions; the addition of extended fields is not much different from ordinary fields, it just adds a feature. .
3) Due to the high degree of abstraction of the relationship between entities (eventually abstracted into horizontal and parent-child recursive relationships), the interface of the database access layer is very versatile and can adapt to any relationship between entities. This kind of design cannot be expressed in ordinary words; maybe you will understand it after reading the code;
4) Absorbed many good designs in CS, such as Provider mode, dynamically constructing SQL to implement custom queries, caching, multi-language resource file design, custom Url rewriting, Ajax functions, etc;
5) Excellent operating performance;
6) Use a simple background management system of the article publishing system as a demo to demonstrate some functions of this framework;
7) At present, the framework is still being continuously improved and optimized. .
Precautions for use:
First attach the Sql database file under DB
1) The database link information needs to be correctly set in the web.config file
This database link string.
2) The page address has been rewritten, and the real page is placed, as in the following example:
In the ControlPanelArticle directory, URL address rewriting configuration information is placed in the Urls.xml file.
3) If you want to debug the article management module, the code is in
AppCodeControlsControlPanelArticle
Set a breakpoint in the CS file in the directory, and then debug by attaching to the process.
Because this Demo is not designed as a WebSite, but in the form of a Library, it can only be debugged by attaching to the process.
In addition, I also made a link to quickly add article test data, the address is:
http://localhost/createarticles.aspx?count=100
Among them, count=100 means creating 100 articles. You can change it to any value greater than zero to create the test data you need.
After my test with 20,000 pieces of data, I found that the performance is good. More data has not been tested.
I believe the performance of this framework should be pretty good. When I designed it, many parts were specifically designed for performance.
Expand