views:

37

answers:

1

I am checking if I can use Entity Framework or NHibernate to build a conceptual model where fields of some classes are mapped from different physical data sources.

EF looks promising, at least on paper: this blog post mentions that "you can mix and match a number of different database vendors, application servers or protocols to design an aggregated mash-up of objects which are constructed from a variety of tables, sources, services, etc." I am not sure NHibernate is capable of this, but I guess I would have to sacrifice Fluent NHibernate syntax if I mix columns coming from tables from different data sources in the same logical entity.

This feature can be quite challenging for data updates - ORM will have to manage distributed transactions, won't it?

So in case you had good or bad experience with such approach, please share it.

+1  A: 

I can vouch for EF working with multiple data sources, but I ultimately chose not to use it for my current project because the project required accessing data sources where the database schemas were somewhat arbitrary--something that I'm sure EF could handle, except I didn't want to deal with the huge overhead of setting it up and then not being able to use the GUI because I was changing things at runtime anyway. (At least this is my poor understanding of the situation).

If your project has relatively stable databases then by all means go for EF! I enjoyed working with EF immensely.

I'd recommend Programming the Entity Framework as an excellent resource with walkthroughs and enough details for experienced programmers.

[EDIT] N.B.: I was using EF 4.0, with .NET 4.0 and VS2010.

Cpfohl
Thank you, I will try to do some tests with EF and multiple sources.
Vagif Abilov