Permission System for Architecture Design sharing (see figure)

Source: Internet
Author: User
Tags database sharding

In the previous article "architecture as you want", I mentioned some ideas about architecture design. In fact, it is also a summary of the previous project experience. Today, we will talk about how to design a permission system and how to implement the system with the following features:

  1. Organized: if the system organization is better, you can get twice the result with half the effort.

  2. Encapsulated: effectively encapsulate functions, structures, and data, making system maintenance easier.

  3. Reusable: effectively encapsulate common functions and components to make the system clear and easy to maintain.

  4. Extensible!

  5. Replaceable: in many cases, we need to consider the replacement of systems, components, or functions, because requirements change.

  6. Testable: To achieve system testability, it will greatly help development and maintenance, and play a very important role in team development and division of labor and collaboration.

  7. Loose coupling: isolated coupling is a factor that must be taken into account in architecture design. If the system cannot achieve high cohesion or low coupling, it is being maintained and upgraded, new function development will be a nightmare!

  8. High Performance, therefore, when designing the architecture, you must make reasonable planning from the database, logic, service, and UI.

  9. Scalability: if you can do the preceding operations, I believe your system must have scalability.

  10. Enjoy your life: the last and most important point is not to be busy with repetitive code farming, drinking a cup of coffee, enjoying code, going home early, spending time with your wife, children, and traveling around the world, enjoy life!

For a long time, let's start to look at the figure:

Architecture design diagram:

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" image "src =" http://image.mamicode.com/info/201409/20181013165141323286.png "alt =" image "border =" 0 "Height =" 550 "width =" 783 "/>

Deployment and component diagram:

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" 28-7-2014 12-27-11 am "src =" http://image.mamicode.com/info/201409/20181013165141876041.jpg "alt =" 28-7-2014 12-27-11 am "border =" 0 "Height =" 470 "width = ""774"/>

Detailed solution:

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" image "src =" http://image.mamicode.com/info/201409/20181013165141989327.png "alt =" image "border =" 0 "Height =" 770 "width =" 627 "/>

01_client: stores UI-related projects, such as winform, WPF, ASP. NET, Silverlight, ASP. net mvc, or related web model and view model projects.

02_hosting: stores service-related projects, which can be direct service, remoting service, Web Service, WCF Service, or web API service.

03_domain: All entities and operations related to business logic (design classes and relationships between classes based on OO ideas ).

04_infrastructure: non-business functional framework (data, common, datacontract, AOP, IOC, logging, encryption, email ).

05_database: Database project (including all database scripts for convenient development, deployment, and maintenance ).

06_tests: All test items (Data Access testing, framework testing, business logic testing, service testing, and view model testing ).

07_referencelibs: project-related external references.

08_tools: some simple tools for convenient development, testing and deployment.

Invocation sequence of each layer (the service adapter needs to be called before calling the service, and then the project configuration determines whether to call the WCF Service, web API service or direct DLL reference ):

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" 28-7-2014 12-34-29 am "src =" http://image.mamicode.com/info/201409/20181013165142093823.jpg "alt =" 28-7-2014 12-34-29 am "border =" 0 "Height =" 464 "width = ""840"/>

 

Permission System Design (multi-system, multi-module, group, multi-user source, function permission, data permission, etc ):

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" security "src =" http://image.mamicode.com/info/201409/20181013165142479580.jpg "alt =" security "border =" 0 "Height =" 426 "width =" 840 "/>

 

Permission System database relationship diagram (three centers: users, roles, paths ):

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px none; width: 844px; "Title =" image "src =" http://image.mamicode.com/info/201409/20181013165142545012.png "alt =" image "border =" 0 "Height =" 439 "width =" 851 "/>

 

All tables of the permission system (including the main tables and backup tables, mainly for Small and Medium Projects, if large projects require database sharding, table sharding, and partition policies ):

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" image "src =" http://image.mamicode.com/info/201409/20181013165142640719.png "alt =" image "border =" 0 "Height =" 625 "width =" 262 "/>

 

Database Project-script precautions and how to execute all database scripts with one click (this facilitates the management of database scripts and greatly facilitates team development and division of labor and collaboration ):

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" image "src =" http://image.mamicode.com/info/201409/20181013165142745215.png "alt =" image "border =" 0 "Height =" 422 "width =" 274 "/>

 

Code Generator -- T4 completely generates databases, business entities, business layers, service layers, and UI code (we used to write code Generators Using winform and WPF before. This is the first time we used T4 to generate the entire project, it is very easy to use, and can be modified at any time, and can also be customized according to the project ).

650) This. width = 650; "style =" background-image: none; padding-top: 0px; padding-left: 0px; padding-Right: 0px; Border: 0px; "Title =" image "src =" http://image.mamicode.com/info/201409/20181013165142875103.png "alt =" image "border =" 0 "Height =" 595 "width =" 272 "/>

This article focuses on reading pictures, so if you have any feedback, experiences or suggestions, leave a message and I will try my best to reply today.

If you think this article is good or rewarding, click (Like)Button, because your support is the biggest motivation for my writing and continuing to share!


This article is from the "Temple Knight" blog, please be sure to keep this source http://knightswarrior.blog.51cto.com/1792698/1547232

Permission System for Architecture Design sharing (see figure)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.