Developing an Object Oriented Business Component Using WCF and Visual Studio 2008
(Page 1 of 5 )
In this article, we will focus on implementing OOPS to develop a business component using WCF. We will also use Visual Studio 2008 beta. Finally, we will access it using ASP.NET 3.5.
A
downloadable zip file is available for this article.
If you are new to WCF, I strongly recommend you to go through my previous two articles available at:
The entire source code for this article is available in the form of a downloadable zip file. The solution was developed using Microsoft Visual Studio 2008 Beta 2 with Microsoft SQL Server 2008 beta on Microsoft Windows Server 2003 Enterprise Edition. I didn’t really test it in any other environment. I request that you post in the discussion area if you have any problems with execution.
Understanding the Sample Visual Studio Solution
As I already explained the step-by-step creation of a WCF Service Library in a previous article, I will not go through the details of those steps. But, before proceeding further, let us try to understand the Visual Studio solution created for this article. The following is a glimpse of the solution explorer (Fig 01).

From the above figure, we have three different projects combined as a single solution. The name of the solution is “WCFNorthwindBLLService.” It is comprised of the following three projects:
NorthwindBLLService
NorthwindBLLServiceHost
WCFClientWebsite
“NorthwindBLLService” is created based on the “WCF Service Library” template. This project contains all of the business logic, developed using object oriented techniques. The following are the classes defined as part of this project.
Product
Products
IProductService
ProductFactoryService
DBHelper
The explanations for each of those classes are detailed in the successive sections.
“NorthwindBLLServiceHost” is created based on the “Windows Forms” template. It is an application which simply hosts “NorthwindBLLService” as a service. The service can be started or stopped using this simple application. You will have to start the service to make “NorthwindBLLService” work.
“WCFClientWebsite” is created based on the “ASP.NET website” template. It is a web application which accesses the “NorthwindBLLService” through “NorthwindBLLServiceHost” and finally interacts with the business classes. A service reference is added to “NorthwindBLLServiceHost” as part of its development.
Next: Understanding the WCF Business Component >>
More BrainDump Articles
More By Jagadish Chaterjee