Free Sample
+ Collection

WCF Multi-tier Services Development with LINQ

Progressing
Mike Liu

Build SOA applications on the Microsoft platform in this hands-on with this book and eBook
$20.25
$44.99
RRP $26.99
RRP $44.99
eBook
Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781847196620
Paperback384 pages

About This Book

  • Master WCF and LINQ concepts by completing practical examples and apply them to your real-world assignments
  • First book to combine WCF and LINQ in a multi-tier real-world WCF service
  • Ideal for beginners who want to build scalable, powerful, easy-to-maintain WCF services
  • Rich with example code, clear explanations, interesting examples, and practical advice – a truly hands-on book for C++ and C# developers

Who This Book Is For

This book is for C# and C++ developers who are eager to get started with WCF and LINQ, and want a book that is practical and rich with examples from the very beginning. Developers and architects evaluating SOA implementation technologies for their company will find this book particularly useful because it gets you started with Microsoft's tools for SOA and shows you how to customize our examples for your prototypes.

This book presumes basic knowledge of C# or C++. Previous experience with Visual Studio will be helpful but is not required, as detailed instructions are given throughout the book.

Table of Contents

Chapter 1: SOA Service Oriented Architecture
What is SOA?
Why SOA?
How do we implement SOA?
SOA from different users' perspectives
Complexities in SOA implementation
Web services
Web services: standards and specifications
Summary
Chapter 2: WCF Windows Communication Foundation
What is WCF?
Why is WCF used for SOA?
WCF architecture
Basic WCF concepts WCF ABCs
WCF production and development environments
Summary
Chapter 3: Implementing a Basic HelloWorld WCF Service
Creating the HelloWorld solution and project
Creating the HelloWorldService service contract interface
Implementing the HelloWorldService service contract
Hosting the WCF service in ASP.NET Development Server
Creating a client to consume the WCF service
Summary
Chapter 4: Hosting and Debugging the HelloWorld WCF Service
Hosting the HelloWorld WCF service
Debugging the HelloWorld WCF service
Summary
Chapter 5: Implementing a WCF Service in the Real World
Why layering a service?
Creating a new solution and project using WCF templates
Creating the service interface layer
Adding a business logic layer
Summary
Chapter 6: Adding Database Support and Exception Handling to the RealNorthwind WCF Service
Adding a data access layer
Adding error handling to the service
Summary
Chapter 7: Modeling a WCF Service with Service Factory
What is the Service Factory?
What are Guidance Packages?
Preparing environments
Differences between the December 2006 version and the February 2008 version
Modeling the data contracts
Modeling the service contracts
Specifying the implementation technology for the models
Generating source code
Summary
Chapter 8: Implementing the WCF Service with Service Factory
Creating the business entities
Customizing the data access layer
Customizing the business logic
Translating the messages
Customizing the Fault contract
Customizing the product service
Modeling the host application and the test client
Customizing the client
Testing the service
Summary
Chapter 9: Introducing Language-Integrated Query (LINQ)
What is LINQ
Creating the test solution and project
New data type var
Automatic properties
Object initializer
Collection initializer
Anonymous types
Extension methods
Lambda expressions
Built-in LINQ extension methods and method syntax
LINQ query syntax and query expression
Built-in LINQ operators
Summary
Chapter 10: LINQ to SQL: Basic Concepts and Features
ORM Object-Relational Mapping
Comparing LINQ to SQL with LINQ to Objects
LINQ to Entities
Comparing LINQ to SQL with LINQ to Entities
Creating LINQ to SQL test application
Modeling the Northwind database
Querying and updating the database with a table
Deferred execution
Deferred (lazy) loading versus eager loading
Joining two tables
Querying a view
Summary
Chapter 11: LINQ to SQL: Advanced Concepts and Features
Calling a stored procedure
Compiled query
Direct SQL
Dynamic query
Inheritance
Handling simultaneous (concurrent) updates
Transactions support
Adding validations to entity classes
Debugging LINQ to SQL programs
Summary
Chapter 12: Applying LINQ to SQL to a WCF Service
Creating the LINQNorthwind solution
Modeling the data contracts
Modeling the service contracts
Generating the source code
Modeling the Northwind database
Implementing the data access layer
Implementing the business logic layer
Implementing the service interface layer
Creating the host application and the test client
Testing the GetProduct and UpdateProduct operations
Testing concurrent update manually
Testing concurrent update automatically
Summary
Chapter 13: Distributed Transaction Support of WCF
Creating the DistNorthwind solution
Testing the transaction behaviour of the WCF service
Enabling distributed transaction support
Understanding distributed transaction support of a WCF service
Testing the distributed transaction support of the WCF service
Summary

What You Will Learn

  • Create, host, and consume your first WCF service in just a few minutes
  • Explore and learn different hosting and debugging options for a WCF service
  • Build a multi-tier real-world WCF service from scratch to understand every layer of a WCF service and apply it to your real work
  • Add exception handling to your WCF services
  • Accelerate your WCF service development with Service Factory by applying best practices
  • Understand basic and advanced concepts and features of LINQ and LINQ to SQL
  • Communicate securely and reliably with databases by rewriting the data access layer of your WCF service with LINQ to SQL
  • Control concurrent updates to the databases and add distributed transaction support to your WCF services

In Detail

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.

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.

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.

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.

Authors

Read More

Recommended for You

WCF 4.0 Multi-tier Services Development with LINQ to Entities
$ 29.99
Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications
$ 29.99
WCF Multi-layer Services Development with Entity Framework - Fourth Edition
$ 32.99