Answered by:
WCF vs. Local Database

Question
-
So lets say I want to develop an application which at first will be client server for simplicity. Then down the road we want to expand to utilize WCF. Is their a framework which will allow you to switch between using the data access layer a wcf front-end data access layer and the business logic layer? We have a solution which we don't think is pretty but will do the trick. I was hoping someone might have built a framework to handle switching between Direct Data Layer and WCF Data Layer.
Thanks!Thursday, July 16, 2009 12:40 AM
Answers
-
You will need to add an extra layer of indirection in to your application so the client call goes through an abstraction to either the Data Access Layer directly or to a WCF proxy. The standard pattern for doing this is Inversion of Control and Dependency Injection
http://martinfowler.com/articles/injection.html
You might want to look at the Castle Project
http://www.castleproject.org/container/index.html
Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
Twitter: richardblewett- Proposed as answer by Will.Rogers Thursday, July 16, 2009 1:10 PM
- Marked as answer by Steven Cheng - MSFT Thursday, July 23, 2009 4:10 AM
Thursday, July 16, 2009 6:30 AM -
Hi Sam,
Here is another option : http://www.lhotka.net/cslanet/
This a framework that can do that for you. It is based about building proper OO business objects. The calls to business objects can execute locally or via WCF or other transports depending on configuration.
The main downside is that it will take you time to learn it:)
Hope this helps.- Proposed as answer by Wael HamzeMVP Thursday, July 16, 2009 8:59 AM
- Marked as answer by Steven Cheng - MSFT Thursday, July 23, 2009 4:11 AM
Thursday, July 16, 2009 8:49 AM
All replies
-
Hi Sam,
This is the best I can offer ;) : ADO.NET Data Services (http://msdn.microsoft.com/en-us/data/bb931106.aspx).
It provides a WCF service interface to an Entity Framework data access layer.
Hope it helps.
Regards,
Rodrigo.Thursday, July 16, 2009 3:52 AM -
You will need to add an extra layer of indirection in to your application so the client call goes through an abstraction to either the Data Access Layer directly or to a WCF proxy. The standard pattern for doing this is Inversion of Control and Dependency Injection
http://martinfowler.com/articles/injection.html
You might want to look at the Castle Project
http://www.castleproject.org/container/index.html
Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
Twitter: richardblewett- Proposed as answer by Will.Rogers Thursday, July 16, 2009 1:10 PM
- Marked as answer by Steven Cheng - MSFT Thursday, July 23, 2009 4:10 AM
Thursday, July 16, 2009 6:30 AM -
Hi Sam,
Here is another option : http://www.lhotka.net/cslanet/
This a framework that can do that for you. It is based about building proper OO business objects. The calls to business objects can execute locally or via WCF or other transports depending on configuration.
The main downside is that it will take you time to learn it:)
Hope this helps.- Proposed as answer by Wael HamzeMVP Thursday, July 16, 2009 8:59 AM
- Marked as answer by Steven Cheng - MSFT Thursday, July 23, 2009 4:11 AM
Thursday, July 16, 2009 8:49 AM