in

The ORM Foundation

Get the facts!

NORMA VS2010 PLiX Implemenation error

Last post 04-25-2012 15:26 by Tyler Young. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-02-2011 7:39

    NORMA VS2010 PLiX Implemenation error

    I’ve been attempting to reverse engineer object role models into Visio UML diagrams by using Visual Studio 2010 Ultimate.

    I have been successful in reverse engineering a very simple object role model based around the proposition “Person buys Car”, which I have attached to this post. However when I attempt to repeat the procedure for more complicated object role models such as the Talent Agency role model found in the ORM Foundation library or for one of my own projects, the NORMA generator throws an error.

    Here is the procedure I used
    1.    I created a new C# windows forms application project in VS 2010 ultimate
    2.    I added the Talent Agency ORM to the project
    3.    In the properties window for the ORM, I changed the ORMGeneratorSettings to include PLiX_Implemenation, and then clicked save changes
    4.    I then opened up “Talent.Abstract.PLiX.cs” which explained that the generator threw an exception. I’ve attached this file to the post also.

    If I repeat the same procedure for the simple ORM I attached to this post, the generator works flawlessly. Additionally, for a ORM i'm creating for a university project, when I attempt the same procedure the generator also throws an error stating that "The required attribute 'dataTypeName' is missing." I've triple checked my data types and even rebuilt the model entirely and I still get the same error. If it helps to understand the problem then I can send these files to you also.

     

     Tom

  • 12-31-2011 11:44 In reply to

    Re: NORMA VS2010 PLiX Implemenation error

    Hi Tom,

    Apologies for the slow reply. This one slipped through the cracks.

    There are a number of issues with these generators, which obviously need some time investment to bring up to date:

    1. They are using an older, xsl-based form of the attribute-based ORM mapping. The relational generators use an in-memory form that is several generations beyond this now.
    2. They aren't normalizing names. Spaces in value type names cause lots of problems, including the trailing space in the Talent.EyeColor object type name.
    3. Duplicate uses of a value type in one table aren't handled
    4. Some data types are not mapped
    5. etc

    I think most of the data type errors are coming from schema validation at the plix level because the names are bogus. The transforms here generate a PLiX xml file and set the NUPlixLoader custom tool property, which then generates the correct code for the project type (VB or C#). This generator does schema validation, so one error in the plix file will stymie the whole process. You can see the errors in context by opening the .plix.xml file and using the standard Error List tool window to see the schema validation errors.

    Having said that, the PLiX generation transforms are much more forgiving than the schema validation, and PLiX installs a helper window called the PLiX Snippet Preview Window under the View/Other Windows menu. If you open this preview window and the .plix.xml file, and select the plx:root node in the document, then you'll see the majority of the code. It won't compile, but you can copy it and and fill in the blanks. The preview window also lets you choose output language, which is determine by the project type for the custom tool based generator.

    In VS2008 and VS2010 you also have the 'LinqToSql Attribute Mapping', which is an alternate (and much newer) plix-based code generator. I saw significantly fewer PLiX errors here (dataTypeName="Byte[" should be dataTypeName=".i1" dataTypeIsSimpleArray="true"). You might try running this generator instead of one against your model in VS2010.

    Sorry these aren't in better shape. They were student projects from several years ago and I haven't had the bandwidth to keep them up to date.

    -Matt

  • 04-25-2012 14:09 In reply to

    • Tyler Young
    • Top 10 Contributor
      Male
    • Joined on 08-27-2009
    • South Jordan, Utah, USA
    • Posts 49

    Re: NORMA VS2010 PLiX Implemenation error

    Is the .NET Reflector required for the Snippet Preview Window to work? I'm working in VS2010 and can't see it. Though come to think of it, I may have just done a bad thing... I installed PLiX from the SourceForge page; it was probably already installed from NORMA. Drat.
  • 04-25-2012 15:26 In reply to

    • Tyler Young
    • Top 10 Contributor
      Male
    • Joined on 08-27-2009
    • South Jordan, Utah, USA
    • Posts 49

    Re: NORMA VS2010 PLiX Implemenation error

    Answered my own question. I re-installed NORMA from the download in the ORM Foundation library, and all is well. I figured this would be the solution, but I wanted to go ahead and ask the question so that other people who do the same thing can search for it. To sum up: I installed PLiX from the SourceForge project page. It was probably an older version. When I went to View -> Other Windows, the PLiX Snippet Preview Window wasn't available. To fix it, I downloaded the newest version of NORMA and installed it. Problem solved! Now I just need to write my generators. :-\
Page 1 of 1 (4 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service