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:
- Procedural programming – no code/app reuse was possible and it required a lot of code to plumb the apps
- Object Orientated programming – no code reuse possible outside the app
- 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:
- Assembly and Namespace
- Data Contracts
- Service Contracts
- Service Host
- Client Proxy
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