Creating a Data Access Layer when using Web Client Software Factory 2010
I am exploring WCSF and wondering how is the data access layer created? Some of the articles I have found are two years old and talk about using Web Service Factory开发者_C百科. I am using VS 2010 and .Net 4.0. I am looking for some sample and tutorials with real world examples.
The Web Client Software Factory doesn't provide automated guidance for creating the data access layer. It's focus is primarily on providing guidance to facilitate composite Web application development (i.e. Web applications which are comprised of individual modules, often developed by different development teams).
There are several approaches for accomplishing data access, but a few resources you might want to check out are the ASP.Net MVC Nerd Dinner tutorial, the S#arp Architecture project, the Code Camp Server source, and the Microsoft Pattern & Practices Data Access Guidance. All of these use variations of the Repository pattern which is the predominate approach among teams following Domain-Driven Design.
There is a good reference implementation hidden in the WCSF2010 Source file, and a few other examples. On http://webclientguidance.codeplex.com, click Web Client Software Factory 2010 Source and then download WCSF2010Source.zip. Inside you'll find Trunk\Source\GlobalBankRI\GlobalBank.Commercial.EBanking (VSTS Tests).sln, which is a pretty good example of many aspects of WCSF, including data access through a WCF service. There are some other simpler examples in the Trunk\Source folder.
Only the ETF module is fully built out. Each view presenter uses an ETFController to manage data common to all presenters. The ETFController uses an instance of IAccountServiceAgent, realized by AccountServiceAgent (for non-unit testing), which is registered as a module. AccountServiceAgent uses a class that acts as a proxy for the WCF reference. The proxy instance to use, AccountServiceProxy, is hardcoded.
The actual source code for WCSF is in BlocksTrunk\Source.
Yeah, not at all easy to find. I don't remember what made me download this and look inside for such examples. Certainly not anything I read on the website.
I've used this example to build a web app that access SQL data and scrapes a website, if you'd like to take a look. It's still under development, but the data access bits are pretty firm: http://lcbodrinkfinder.codeplex.com/
精彩评论