Database design / normalization structure needs to contain ANDs, ORs, optional elements and their relationships

后端 未结 5 941
轮回少年
轮回少年 2021-02-06 07:31

I want to store the details of college courses in a (MySql) database but I\'m not sure how to maintain the relationship between modules and selections.

Basically, a cour

5条回答
  •  执笔经年
    2021-02-06 08:23

    A production quality system using and/or's (like your system) that you can review for free is entlib 5.0 Security block. http://entlib.codeplex.com/

    Each rule is retrieved by name to get the full expression. the patterns & practice team created their own short DSL for the expression to avoid complicating the xml structure/db structure.

    this is inside the hands on labs exercise ex02 app.config. To store rules inside the database you would need to implement a custom AuthorizationRuleProvider.

    R: = rolename; U: = username

      
    
      
        
          
          
          
        
      
    
    

    dev usage

        public static AssignBug Create()
        {
            // TODO: Check Authorization
            if (!SecurityHelper.Authorized(AuthRule.Assign))
            {
                throw new SecurityException();
            }
    
            return new AssignBug();
        }
    

    While not an immediate answer I think this provides a good example of how to implement rule-expression based systems.

提交回复
热议问题