Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Tuesday, May 24, 2011

Introduction to SOA and WCF

Key learning below from the presentation below:

SOA (definition): The decomposition of a system in autonomous, discoverable, and secure units of responsibility and interoperable exposure of said units.

SOA decomposes an application into services and allows connectivity of dissimilar technologies. SOA is the next evolution of programming, design, architectural paradigm.

Other legacy paradigms that the IT industry has witnessed are:

  1. Procedural programming – no code/app reuse was possible and it required a lot of code to plumb the apps
  2. Object Orientated programming – no code reuse possible outside the app
  3. Component Oriented Programming – objects housed within libraries (.dll) required external service management (COM+, MTS, Corba etc)

Then came along Service Oriented Programming where objects were encapsulated within autonomous services each with its own set of responsibilities. SOA programming needed a good “glue” technology to handle plumbing for ancillary technologies. Technologies had to be interoperable – enter WCF.


Service is an encapsulated unit of responsibility that is atomic, durable, secure and always leaves the system in a consistent state. In order to build an SOA system, you must functionally decompose a system to smallest units of responsibilities possible.


Windows Communication Foundation provides an unified communication model with: Web Services, Remoting, Sockets, Enterprise Services, MSMQ. WCF enforces a message based communication approach.

WCF consists of:

  • System.ServiceModel/System.ServiceModel.Web
    • Assembly and Namespace
  • Data Contracts
  • Service Contracts
  • Services
  • Service Host
  • Client Proxy
  • Configuration

Service Contracts are interfaces that define service operations which work with single type of data contracts.

Use [ServiceContract], [OperationContract]

Data Contracts  defines the data that is to be received/returned by a service. Data Contracts must be serializable [DataContracts] System.Runtime.Serialization.

Service Classes provides the service implementation of one or more service contracts and returns a data contract.

Services can be hosted on IIS using HTTP services.

Configure your service