in

The ORM Foundation

Get the facts!

Where to start with mapping equality set constraint to sql check constraint?

Last post Mon, Sep 12 2016 16:55 by shada22. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Fri, Sep 9 2016 23:08

    • shada22
    • Top 50 Contributor
    • Joined on Fri, Dec 19 2008
    • Posts 18

    Where to start with mapping equality set constraint to sql check constraint?

     I was looking at the sql server code generation again since I'm using Norma for more modeling again. Yay! 

     

    I was trying to understand where the absorption logic resides for DCIL. ConceptualDBToDCIL clearly does some of it, but it seems as if the relational view as persisted in the orm file cover some of it as well.

     

    Could you help me understand how the responsibilities of this stuff breaks down?

     

    For this attempt I'm only caring about set comparison constraints that only involve one sql table.

     

    Thanks,

    Bill

     

  • Sat, Sep 10 2016 10:22 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 748

    Re: Where to start with mapping equality set constraint to sql check constraint?

     Hi Bill,

    If you look at the forum, you will see that you are one of many people who has tried to understand the NORMA code with a view to fixing bugs and/or adding new features. 

    Matt really is the best person to answer this question but whilst he is aware of your question, he is snowed under with other work. 

    Over the years, Matt has made a huge contribution by maintaining and improving NORMA and it seems to me that he has received much less recognition than he deserves.

    But the bottom line is that right now we depend on Matt's goodwill for fixes and improvements.

    Any multi-person development project requires properly documented code but NORMA is undocumented..

    So as I see it, we need to document NORMA to establish a baseline for future work.
    This requires a few people to collaborate to document the NORMA code.

    Would you like to participate in such a project?

    Ken 

     


     


  • Sat, Sep 10 2016 13:57 In reply to

    • shada22
    • Top 50 Contributor
    • Joined on Fri, Dec 19 2008
    • Posts 18

    Re: Where to start with mapping equality set constraint to sql check constraint?

     Matt certainly has done an amazing job keeping NORMA going over the years. I certainly always enjoy being able to use it for my infrequent data modeling needs. Sometimes I wish I had cause to use it more often. 

     

     I certainly wouldn't mind participating in such a project. The few times over the years I've looked at NORMA's code, I have frequently wished for some brief sort of overview document about how/where some of the core NORMA features are accomplished. Sort of an architectural outline if you will. 

     

    Orm validation, relational mapping, verbalization, hand off of responsibility from relational view to generation, etc... 

     

    It probably would be good to know if the approach in NORMA for relational mapping has any marked differences from the 2nd edition contents (modulo just not having done the work yet of course). 

     

    I realize most of this stuff is probably hidden among the details of visual studios DSL related code, but at least there was a book written (even if a long time ago) going into some of those visual studio details.  

     

    How do you think we might go about documenting the NORMA code base? Ideally such a process tends to go faster with knowledgeable assistance. I've tried to avoid actually debugging NORMA to find some of these answers mostly because that tends to be a particularly inefficient way of extracting these kinds of things.

     

    Thanks,  

     Bill 

     

  • Sat, Sep 10 2016 15:36 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 748

    Re: Where to start with mapping equality set constraint to sql check constraint?

     Hi Bill,

    Thanks for your post. I'll work on this and get back to  you.

    Ken 

  • Mon, Sep 12 2016 16:55 In reply to

    • shada22
    • Top 50 Contributor
    • Joined on Fri, Dec 19 2008
    • Posts 18

    Re: Where to start with mapping equality set constraint to sql check constraint?

    I did some investigation over the weekend, and I think I've discovered some of the pieces of information I need. It seems like it ought to be feasible to add Simple (Subset, Equality, Exclusion (including mandatory), and Value Comparison) Constraints to the ConceptualDB generation code that is in the Dil.sln code. That way, the code generation templates can easily transform the necessary data into SQL or whatever else strikes their fancy. Actually using the ConceptualDB CheckConstraint didn't seem wise since sucking all of dep:boolValueExpression into the DSL modeling layer seemed horrendously excessive at present.

     I think my next step is to see whether or not the orm constraints I'm interested in can be accessed from the ConceptualDB generation level, or whether I might need to lower the constraints through the OIAL level as well.

    Debugging NORMA, here I come,

    Bill 

Page 1 of 1 (5 items)
© 2008-2018 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service