locked
DAAB or Entity Framework RRS feed

  • Question

  • My windows application has to access data from 3 different databases(MS SQL Server, Oracle and Sybase).I need not connect to all the three datbases at the same time, I need to connect to the any one based on user preferences .I do want to write database agonistic code to target the three databases.

     

    However Iam not sure if I should use DAAB ( I could not find much examples about Sybase and DAAB) or the Entity Framework or any other ORM tools. Since all I would need from this code is to de basic operations like Insert,update,delete I am not sure if a ORM is really needed in this case.I also looked at products like Data Direct which provide ADO .net providers for writing database agonistic code, but I would like some other opinions as well.

     

    Thanks

    Thursday, July 17, 2008 12:30 AM

Answers

  • I have done it some time ago through creating my own database factory. It is basically Factory design pattern. Since current .NET Database Factory did not meet my requirements, I have created my own, which is very similar to .NET one. Basically I have created base class that provides all the required methods to implement. Then I have created specific classes inheriting from that base class. Then I have created Factory that loads specific DLL for specific provider and exposes objects as of my base class. It did not take a lot of time to create, so you should be fine if you do it yourself.

     

    Saturday, July 19, 2008 11:12 AM

All replies

  • I have done it some time ago through creating my own database factory. It is basically Factory design pattern. Since current .NET Database Factory did not meet my requirements, I have created my own, which is very similar to .NET one. Basically I have created base class that provides all the required methods to implement. Then I have created specific classes inheriting from that base class. Then I have created Factory that loads specific DLL for specific provider and exposes objects as of my base class. It did not take a lot of time to create, so you should be fine if you do it yourself.

     

    Saturday, July 19, 2008 11:12 AM
  • Additional note is EF is great for SQL Server today but Oracle and other vendors are still working on their providers.

    So EF is getting there but is not there quite yet.

     

    Factory design as VMazur suggests is best way to go today, or you could see if .NET Database Factory meets your needs.

     

    Also, if either one of you folks has suggestions as to how we can improve .NET to support these scenarios, let me know, I can feed this into the future designs.  For example, what areas are weak (metadata?) etc...  What features would you like to see to help meet your goals?

    Monday, July 21, 2008 5:20 PM
  • Thanks Matt. Regarding metadata, is there any other method to get information in a scenario like this:

     

    I have a table say B that has foreign keys , that reference another table say A.

     

    Is there a method by which I can get the validated field's table name (A's name) by quering B?

     

    Iam aware of the GetSchema method, but Iam not sure of how useful it will be considering that I haev three different databases (Oracle,SQL,Sybase).

     

     

     

    Friday, July 25, 2008 4:34 PM