ericpap
ericpap

Reputation: 2937

Dealing with database changes on WCF Service application

I'm working on a Project to migrate a client-server application to .NET. Right now i have divided the Project in 3 layers:

* DataLayer (Entity framework) DLL
* ServiceLayer (WCF Service) DLL
* ClientLayer (WPF EXE, using MVVM pattern)

The App needs to connect to multiple database (similar structure). The databases are often changed to reflect new business requeriments).

Now my questions are:

1) Is this scenario suitable for Entity Framework (because of dealing with database changes)?

2) In this case, if i need to add a new field to say customer table, i should add the field to the database, and then update the schema on DataLayer, right? I also need to update the contracts on service layer to reflect proxy clases... and also need to modify client to change the view to obtain and send the new field to the database. So i need to re-compile all three modules for a single field added to one table?

3) Is there a best alternative on .NET for dealing with this problems, in a way that if i need to add a new field to one table i only need to re-compile client side code?

Thanks!

Upvotes: 3

Views: 631

Answers (1)

Justin
Justin

Reputation: 86729

By far the simplest solution will be to get your EF layer to work with all of your database schemas without needing to be recompiled using views.

Build your EF layer on views in the target database. When you make changes to your database make sure that the views are updated so that they behave as they did before. This should mean that your EF layer will work against any database with those views.

Upvotes: 1

Related Questions