ODM mapping in .Net

Aug 24, 2009 at 6:02 PM

I've checked out the project and loaded it into VS2008. I'm interested in how you've implemented the Observation Data Model 1.1.

 

In Solution Explorer you have an ODM1.1 and ODM2.0 folder. I expected a .Net ODM implementation there but found "only" an SOS model. This confuses me a bit, is there an explanation for that? Am I missing something?

 

Thanks for your help

 

  Henning

Coordinator
Aug 24, 2009 at 6:44 PM

The way I imlemented it I wanted to have one model which works against multiple databases so if one wants to implement SOS against his database all he need to do is to replace the queries in the model.

So for example if you open all Sos.edmx model it apears they all look the same but the differns is in the SQL statements.

So if you open all EMDX files as XML files and compare SSDL sections (<edmx:StorageModels>) then youwill see they use different queries.

I use this trick to make it work agais differnt databases. So then in Web.config all i need to do to switch between models is to provide different SSDL section.

For example (the differnces are in bold):

 

    <add name="SosEntities.Renci" connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Odm11.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=katmai.renci.org;Initial Catalog=Odm11;User ID=odm;Pwd=odm;Application Name=SOS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    <add name="SosEntities.4Ioos"

 

 

connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Odm11.OpenIOOS.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=katmai.renci.org;Initial Catalog=Odm11;User ID=odm;Pwd=odm;Application Name=SOS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    <add name="SosEntities" connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Odm11.OpenIOOS.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=katmai.renci.org;Initial Catalog=Odm11;User ID=odm;Pwd=odm;Application Name=SOS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    <add name="SosEntities.Renci" connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Odm11.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=katmai.renci.org;Initial Catalog=Odm11;User ID=odm;Pwd=odm;Application Name=SOS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    <add name="SosEntities.4Ioos" connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Odm11.OpenIOOS.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=katmai.renci.org;Initial Catalog=Odm11;User ID=odm;Pwd=odm;Application Name=SOS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    <add name="SosEntities" connectionString="metadata=res://*/Sos.Sos.csdl|res://*/Odm11.OpenIOOS.Sos.ssdl|res://*/Sos.Sos.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=katmai.renci.org;Initial Catalog=Odm11;User ID=odm;Pwd=odm;Application Name=SOS;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

The main purpose of differnt models are one can see Offering as Sensor or as Organization, or there could be other differences, 
or also, can work against totaly differnt database, other then ODM for example.
Hope it helps,
Please let me know if you have any more questions or problems.
Thanks,
Oleg

 

Aug 24, 2009 at 7:07 PM

Thanks for your answere.

Now I can see that you require an existing database with ODM schema instead of offering an .Net implementation of that model.

 

Thanks for clearing this.

 

  Henning

Coordinator
Aug 24, 2009 at 7:14 PM

well, yes, this is how it works out of box, but if you have your own database with data that you want to expose, you can still use this implemention, you just need to replace queries that work agains ODM databsae with queries that work agains yours and thats it.

 

Oleg

Aug 24, 2009 at 7:38 PM

Yes, I know this pattern .. to abstract from a specific database -- actually I only knew it in form as a Database- or DAOFactory ..

 

Well, I'm was wondering if it would make sense to add (and implement) the ODM layer in my project before connecting ESRIs ArcHydro model (coupling is possible) .. I think, putting that on my roadmap would be more straightforward for now :).

 

Thanks

 

  Henning