alt text


We're planning to use a data mapping tool like Altova MapForce to create a new database with data for analysis and reporting. The idea is to take our legacy databases and other storage's and create a new clean database that is updated nightly with fresh data.

I would like to use DO as a means to retrieve data from that new database. For as far as I know there is no library to reverse engineer databases for DO at the moment so I came up with the idea to generate the model from the metadata in the DB using SQL-SMO and T4.

Before embarking on that journey I need to know some things:

I think I can generated the code for the model from the metadata (using T4 and SQL-SMO) pretty easily. I already have a prototype working that retrieves the DB metadata. Then after having the model compiled I need to access that DB using DO. Normally DO would need metadata in the DB to be able to compare the .Net model with the DB model. Do I also need to generate that information (that is probably going to be a hell of job) or is there another way to achieve that?

If you have other suggestions on how I could achieve the above I would be greatfull.

Regards Paul

asked Aug 15 '14 at 05:17

Paul%20Sinnema's gravatar image

Paul Sinnema

edited Aug 18 '14 at 03:21

One Answer:

Hi Paul.

If your new database is empty (does not contains any tables) then you do not need to create metadata for DO. You should use Perform or PerformSafely upgrade modes. DO will create tables according your generated model (if model is correct) and metadata in new database on first domain building.

NOTE that, if you will need to do some changes (except additions of new types or columns) in model then in PerformSafely mode you will must generate hints for this changes too.

answered Aug 18 '14 at 02:35

Alexey%20Kulakov's gravatar image

Alexey Kulakov

edited Aug 18 '14 at 02:37

Hi Alexey,

I've added the principal diagram to the original question. I have used DO the past 4 years already so I know how it works. The new challenge we face is the green part in the diagram. As you can see we plan to use Altova MapForce to map data from several sources into a Data WareHouse. We would need a reverse engineering tool to extract the model from the DB. I plan to use T4 code generation for that. We generate the DO classes into our datalayer. The question is. What do we need to do in the DB to get this up and running?

(Aug 18 '14 at 03:24) Paul Sinnema Paul%20Sinnema's gravatar image

Thank you for illustration. I have a few questions. Just to create correct view of situation in my mind. If I'm wrong, please, correct me.

1) Will DO be used to create domain on all tables of WareHouse database?

2) As I see, Altova MapForce analyzes current databases and creates tables in WareHouse. And after that, you will create DO classes based on extracted information from WH using T4. Is it right?

(Aug 18 '14 at 09:10) Alexey Kulakov Alexey%20Kulakov's gravatar image

Well after analyzing a bit further we have abandoned this idea. At the DB level the enrichment of the model is not present and it would mean we would have to do the same in Altova which causes redundant code in Altova and C#. We've decided to do the data-mining by hand for now and using the code-first approach of DO.

(Aug 22 '14 at 07:30) Paul Sinnema Paul%20Sinnema's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA