Friday, February 29, 2008
SOA - An Overview
What is SOA?
1. SOA is an approach to organize distributed IT resources into an integrated solution breaking down information silos and maximizing Business Agility.
2. SOA modularizes IT resources, creating loosely coupled business processes that integrate information across business systems.
Definition
SOA uses standard protocols and interfaces - usually web services - to facilitate access to business logic and information among diverse services. Because each process is exposed through a standardized interface, theunderlying implementation of individual service providers can change without affecting the consumers.
Why SOA
Service orientation makes systems more responsive to business needs, simpler to develop, and easier to maintain and manage. Implementing a solution architecture based upon service orientation helps organizations plan ahead for change, rather than responding reactively.
Who does SOA?
SOA is 'done' by developers and solution architects. However, stakeholders in a service-oriented solution span a range of roles, and it is critical that their interests not only be taken into account but that they actively drive the design of the SOA solution. e.g. IT Managers, CIO, CTO, Business Analysts and last but not the least - Developers and Solution Architects.
What SOA isn’t
There are numerous misconceptions about what SOA is—that it is a product that can be purchased (it is not, it is a design philosophy that informs how the solution should be built).
SOA is also a term used interchangeably with web services. SOA is made easier through broad adoption of web-services standard but web-services is an implementation methodology to implement a SOA solution.
SOA Approaches
Top-down and Bottom-up. Both approaches can have possible pitfalls that can prevent success. Many organizations that have attempted to roll out SOA infrastructure through a top-down approach have discovered that when the infrastructure is finally delivered it is out of sync with the needs of the business. Likewise, a bottom-up approach can fail as well, because it can lead to a chaotic implementation of services created with disregard to organizational goals.
The “middle-out” approach is a successful hybrid of the two other approaches. Business drivers and strategic vision are first employed to set clear direction and priorities.
SOA Lifecycle
Expose - The expose phase of the SOA approach focuses on which services to create from the underlying applications and data.
Compose - Once services are created, they can be combined into more complex services, applications, or cross-functional business processes.
Consume - Once a new application or business process has been created, that functionality must be made available for access (consumption) by either other IT systems or by end users. The goal of the consumption process is to deliver new, dynamic applications.
Getting Started
1. Don't “do SOA” rather than address a business need.
2. Organizations that are successful with SOA often adopt a middle-out approach — they start with clear business challenges and focus on creating business value.
3. Demonstrate value in rapid iterations. Time-to-value is a critical, healthy metric.
Cheers! and any feedback and/or comments welcome.
Thursday, August 16, 2007
WCF Concepts and Constructs
1. Messages
When we talk about messages, the first things we need to know is its structure - it consists of a SOAP Envelope, SOAP Header and a SOAP Body.
SOAP Envelope
This is the outermost element and container for Header, Body, Name and Namespace.
SOAP Header
This contains important information not directly related to the message but optional information e.g. School Name for packets containing Student Info. This SOAP Header can also have Child elements called 'Header Blocks' - optional header info.
SOAP Body
This is the crux of the message i.e. basically collection of data items to be used by the SOAP receiver.
A Basic XML sample of Message
<env:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<env:Header>
<o:order xmlns:o="http://www.MySite.com/order" env:mustUnderstand="true">
<o:orderreference>591aef96-0c0d-4534-a1d2-4253b910b0b6</o:orderreference>
<o:orderdate>05/15/2006</o:orderdate>
</o:orderreference>
<p:purchaser xmlns:o="http://www.MySite.com/purchaser" env:mustUnderstand="true">
<p:name>Peter Spano</p:name>
<p:creditcardnum>1234-5678-9012-3456</p:creditcardnum>
</p:orderreference>
</env:Header>
<env:Body>
<c:price xmlns:c="http://www.MySite.com/bookcost">
<c:cost>
<c:retailcost>$49.99</c:retailcost>
<c:salecost>$39.99</c:salecost>
</c:cost>
</c:price>
<q:quantity xmlns:q="http://www.MySite.com/quantity">
<q:orderquantity>1</q:orderquantity>
</q:quantity>
<t:title xmlns:t="http://www.MySite.com/title">
<t:booktitle>WCF - The Book</t:booktitle>
</t:title>
</env:Body>
</env:Envelope>
SOAP Envelope

Messaging Programs
In previous post I taked about SOAP Receivers, what it is and besides it what are the other messaging programs. Let's have a look:
Client --> This is the program which initiates message communication with a service.
Service --> This provides a service to the client and can also 'chain on' to another service.
Further, 2 Clients can call the same 'End Point' of the same Service and the sessions are isolated from each other by the service. Cool eh!
Communication Patterns are either Simplex i.e. One way transmission, Duplex i.e. both Client and Service can send simlutaneously or two way and finally Request-Reply where Client sends a request and waits for an answer.
2. Channels
This is the medium through which messages are exchanged. The process is somewhat liek this:
--> Client Establishes a channel.
--> Service accepts the channel request.
--> Client Sends message/s.
--> Service sends a reply back to the client.
Channel Stack - When each channel performs a specific function during message communication, then number of such channels are called a channel stack. Examples of such Specific functions include:
Security - Transport Security (https) and Message Security (SOAP)
Interop - WS, .NET , MSMSQ
Message Pattern - Simplex, Duplex etc.
Transport - http: Communication Info is not important, tcp: Communication info is important, Named pipes: Single Machine comms between processes, MSMQ: Reliable Delivery.
3. Services
Really the WCF is made up of 'Services' and 'End points' that communicate with clients. The Services are hence composed of:
A) Service Description: How to access this service and what functionality this service provides.
B) End Points: Each Service must have at least one End Point and further each End Point must have a unique Address e.g. "http://MyService/MyFunctionality..."
Each End Point is composed of a Binding, Contract and Implementation. Binding refers to http, basic http, WShttp, Nettcp etc. Contract is a definition of actions for this end point.
Contracts
The Structure and format of a WCF message and the behaviour of the Message is called a contract. It is in the shape of a well formed xml document like WSDL. Several kinds of Contracts:
A) Service Contract: Tells the Clients of the service, what operations this service will perform, the message data types and where this service is located.
B) Message Contract: Allows customization of the format/structure of the message sent and received by WCF. Also allows formatting the parameters of the message.
C) Data Contract: This is the data being exchanged between Client and the server. The two need to agree upon the format for the data exchange to take place. XML Serialization facilitates this exchange; however there is a new serialization in WCF called Data Contract Serialization.
4. Behaviours
The Service Behaviour basically controls the runtime behaviour of the service and/or the End Point. For e.g.:
--> Throttling - No: of threads per process, Concurrency Processing.
--> Security
-->Instancing - Per call, Per session, Single.
--> Transactions etc.
Hope you enjoyed the heaavy reading. Till next post signing off...
PV