Book Image

WCF Multi-tier Services Development with LINQ

By : Mike Liu
Book Image

WCF Multi-tier Services Development with LINQ

By: Mike Liu

Overview of this book

<p>WCF is Microsoft's unified programming model for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate with existing investments. WCF is built on the Microsoft .NET Framework and simplifies development of connected systems. It unifies a broad array of distributed systems capabilities in a composable, extensible architecture that supports multiple transports, messaging patterns, encodings, network topologies, and hosting models. It is the next version of several existing products: ASP.NET's web methods (ASMX), Microsoft Web Services Enhancements for Microsoft .NET (WSE), .NET Remoting, Enterprise Services, and System.Messaging.<br /><br />If you are a C++/C# developer looking for a book to build real-world WCF services, you would have run into the huge reference tomes currently in the market. These books are crammed with more information than you need and most build simple one-tier WCF services. And if you plan to use LINQ in the data access layer, you might buy another volume that is just as huge and just as expensive.<br /><br />Our book is the quickest and easiest way to learn WCF and LINQ in Visual Studio 2008. It is the first book to combine WCF and LINQ in a multi-tier real-world WCF service. Multi-tier services provide separation of concerns and better factoring of code, which gives you better maintainability and the ability to split layers out into separate tiers for scalability. WCF and LINQ are both powerful yet complex technologies from Microsoft, but this book will get you through. The mastery of these two topics will quickly get you started creating service-oriented applications, and allow you to take your first steps into the world of Service Oriented Architecture without getting overwhelmed.<br /><br />Through this book, you will first understand WCF concepts by developing a functional service and apply these techniques to a multi-tier real-world WCF service. You will learn how to use WCF to define the contracts in the service interface layer, Plain Old C# Objects (POCO) to implement business rules in the business logic layer, and LINQ to communicate with the databases in the data access layer. Microsoft pattern and practice Web Service Software Factory is used to create the framework for this WCF service. Concurrency control and distributed transaction support are discussed and tested at the end of the book. Clear step-by-step instructions and precise screenshots will make sure you will not get lost in the new world of WCF and LINQ.</p>
Table of Contents (19 chapters)
WCF Multi-tier Services Development with LINQ
Credits
About the Author
About the Reviewers
Preface
Index

Summary


In this chapter, we have used LINQ to SQL to communicate with the database in the data access layer, rather than use the raw ADO.NET APIs. We have used only one LINQ statement to retrieve product information from the database, and as you have seen, the updates with LINQ to SQL prove to be much easier than with the raw ADO.NET data adapters. Now, WCF and LINQ are combined together for our services, so we can take advantage of both technologies.

The key points covered in this chapter include:

  • Service Factory can be used to model the service, and generate source code for the service interface layer projects.

  • The data access layer should be modeled with LINQ to SQL designer.

  • Business entity classes are all located inside the LINQ to SQL designer file, within the data access layer.

  • The service interface layer and the business logic layer have to reference the data access layer in order to use the entity classes.

  • Client applications still communicate with the service by exchanging messages...