in

The ORM Foundation

Get the facts!

Feature Request: Common Fact Type Patterns from the toolbox

Last post Tue, May 7 2013 23:13 by mnnoon. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • Tue, Nov 2 2010 14:44

    • OrionB
    • Top 50 Contributor
      Male
    • Joined on Thu, Apr 3 2008
    • Tualatin OR
    • Posts 19

    Feature Request: Common Fact Type Patterns from the toolbox

    When using the NORMA tool, I often find myself doing the same action many times:  Dragging a fact type from the tool box, adding a constraint to make it one-to-many, and adding the predicate reading. (often a simple has/is for)

     Might it be possible to add to the toolbox a binary fact type that comes with the constraint already on it? e.g. the ability drag a one-to-many with a has/is for predicate text out of the toolbox? Is this something I already have the ability to do, but just don't yet know how?

  • Tue, Nov 2 2010 15:20 In reply to

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

    Re: Feature Request: Common Fact Type Patterns from the toolbox

    Matt may have something to say about this.

    However, in the meantime, I suggest that you consider using the fact editor for basic facts, I find it to be much faster than the toolbox.

    Just enter a fact such as Person(.id) has FirstName()
    Then click on Ctrl+Enter and the fact is drawn for you.
    This is explained in NORMA Tutorial 1.

    Hope this helps

    Ken

     

    Filed under:
  • Tue, Nov 2 2010 16:30 In reply to

    • OrionB
    • Top 50 Contributor
      Male
    • Joined on Thu, Apr 3 2008
    • Tualatin OR
    • Posts 19

    Re: Feature Request: Common Fact Type Patterns from the toolbox

    The Fact Type Editor is indeed a great way to quickly enter a new fact type. When working with a larger diagram, though, it has the disadvantage of sometimes placing the fact type a fair distance from where I intend it to be, and still needs the extra click or two to add the constraint over the role(s). I do enjoy how I can select two object or value types, bring up the fact editor, type a predicate reading in between them and hit Ctrl+Enter to get a new fact type.
  • Tue, Apr 23 2013 23:21 In reply to

    • OrionB
    • Top 50 Contributor
      Male
    • Joined on Thu, Apr 3 2008
    • Tualatin OR
    • Posts 19

    Re: Feature Request: Common Fact Type Patterns from the toolbox

    -- removing double post--
  • Tue, Apr 23 2013 23:21 In reply to

    • OrionB
    • Top 50 Contributor
      Male
    • Joined on Thu, Apr 3 2008
    • Tualatin OR
    • Posts 19

    Re: Feature Request: Common Fact Type Patterns from the toolbox

    Any idea if this is a possibility yet? Today, I've drawn a one-to-one has/describes fact type several dozen times today, which prompted me to check the feature request forum, and found this old thread.
  • Tue, Apr 23 2013 23:45 In reply to

    Re: Feature Request: Common Fact Type Patterns from the toolbox

    There isn't a way to do this off the toolbox, but you can create a new fact type with an internal pattern by dragging from another (likely temporary) model. Try the following:

    1. Create the pattern you want.
    2. Create a new scratch ORM model.
    3. Drag the fact type you want to emulate from your model to the new model.
    4. Delete the role players in the new model, but leave the fact type (note that the simple mandatory constraints will not draw without the role player lines, but they're still there). Be sure to get rid of the role players, not just the shape.
    5. Drag the role-player free fact type back into your main model to duplicate the pattern.
    6. Drag the role boxes onto object type shapes to attach your role players.

    Note that you can use variations on this to process, such as adding new role players in the temporary model, then dragging across. You're just using the new model as a temporary scratch pad and can use whatever patterns you like. Dragging across without role players guarantees you won't match an existing fact type. Also, if you have a more complicated fact type that you'd like to duplicate, drag it over to your scratch model, modify it (so the readings don't match), then drag it back.

    I believe the cross-model support was added after you asked your last question. There are instructions on cross-model drag in the readme, as well as information on window layout in Visual Studio.

    -Matt

    PS This works best if the reference mode formats match between the two models.

  • Tue, May 7 2013 23:13 In reply to

    • mnnoon
    • Top 10 Contributor
      Male
    • Joined on Wed, Apr 16 2008
    • Lawndale, CA
    • Posts 60

    Re: Feature Request: Common Fact Type Patterns from the toolbox

    I have an adhoc technique that may work for this case.  Try to push your model to the SQL database and generate your SQL scripts.  Make all the changes to names as you see fit and then create those objects in SQL, then re-import (db import) it in after changing all the names.   Some of the primary keys may have changed to something unwanted.  I fix this identity problem by selecting all the entities (holding down control button) with the same identifier like auto identity or bigint and make the change all at once in the properties.  You can also use the context window to pull in the individual entities that you renamed with your matching pattern into your individual pages. 

    I guess in your case you can use a simple program or script to rename your schema and table names and create as many variances as you see fit before performing a db import.

     

Page 1 of 1 (7 items)
© 2008-2024 ------- Terms of Service