Note that there are some explanatory texts on larger screens.

plurals
  1. POHow may I generate a DDL, DML and C# ORM from an XSD file?
    primarykey
    data
    text
    <p>I have been searching for a .Net implementation of the Active Record Pttern, using either the <a href="http://www.castleproject.org/" rel="nofollow">Castle Project</a> or <a href="http://subsonicproject.com/" rel="nofollow">SubSonic</a>.</p> <p>I want to generate ORM classes from an XSD file. Can anyone tell me how to go about doing this?.</p> <p><strong>[Edit]</strong></p> <p>Although the technologies I mentioned seem disparate, here is how I envisage using them together:</p> <ol> <li><p>XSD specifies the entities, data types and permitted values This information maps "naturally" to not only a DDL, but also fixtures data. In short, the XSD can be used to generate <strong>DDL</strong> and <strong>DML</strong> (specifically <strong>INSERT</strong>) statements, so that the newly created database is suitably <strong>initialised</strong> when the DDL and DML statements are generated and run from the XSD.</p></li> <li><p>Ok, so now we have database entities, generated and initialised from the XSD. A natural step is to creat a DB access layer to the underlying database, to provide CRUD functionality - this is where the ORM comes in.</p></li> <li><p>For reasons I won't go into here, I have settled on the Active Record Pattern for Db access, and this is where Castle Project (or SubSonic) comes in to play</p></li> </ol> <p>So, what I am trying to find out is how to automate this process (generating DDL, DML and ORM) so that when the XSD changes, I can synchronize the db and ORM.</p> <p>Like I said before, I know what I want to do, but I don't know if this is the way to do it (thats why I asked the question). I notice that <strong>T4</strong> keeps getting mentioned - maybe this is the way to go - could anyone with some <strong>T4</strong> knowledge tell me if this is possible, and also possible provide a rough guideline as to how to do what I described above?</p> <p>As an aside, the ORM classes are to be in C# - and also, I am running on Linux (mono) not Windows.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWell,at least be civil enough to tell me why you downvoted this and asked for it to be closed?. This question was asked because I want to know if there is a way to generate an ORM (using Casle) from a given XML schema file. I am new to both XML technologies and the Castle project, so wanted to know if what I wanted to do is possible - instead of spending several days to find out if its possible to do this or not. Surely someone out there must know whether this is possible. Don't be mad because you don't know the answer, there are some pretty smart people on here... ;)
      singulars
    2. COCastle ActiveRecord is for use with a relational database. XSDs have nothing to do with relational databases. You may want to look into T4 as something to use for code generation. I would say the question as written is very confusing and it's difficult to tell what is being asked (I didn't downvote it). Why do you think you need an ORM? Do you have a relational database? How does the XSD relate to your relational database (if you have one)?
      singulars
    3. CO@Michael Maddox: Thanks for the comment - I have edited my question to show how I think the technologies "fit together". I will take a look at T4 as well in the meantime. Actually T4 + Subsonic (instead of Castle) may be the way to go. I just need to check if T4 is available for mono.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload