Showing posts with label Service Design Pattern. Show all posts
Showing posts with label Service Design Pattern. Show all posts

Monday, June 15, 2009

SOA Pattern - TestMode

1. Pattern Name
Training Mode
2. Also Known As
N/A
3. Class Name SOA
4. Intent
Even in production environment, it is required to execute a service in testing mode to verify certain facts.
5. Motivation (Forces)
In production environment if some error is occurring which is hard to replicate in testing environment due to lack of proper infrastructure or data?
At the time of deploying a new service in production environment requires assurance due to its importance.
6. Applicability
Service under consideration is composing other services.
Service under consideration has high importance.
7. Structure
N/A
8. Participants
N/A
9. Collaboration
N/A
10. Consequences
1. Increased complexity
2. Ease in testing (especially QoS) in production environment.
11. Implementation
N/A
12. Sample Code
N/A
13. Known Uses
N/A
14. Related Patterns
N/A
15. Reference
N/A

Document at scribd

Tuesday, May 19, 2009

SaaS Pattern - SecureMyData

1. Pattern Name
SecureMyData
2. Also Known As
In house encryption & decryption service
3. Class Name
Architectural: SaaS
4. Intent
In SaaS environment security of customer specific data in multi tenant as well as non multi tenant environment is one of the most crucial concerns.
5. Motivation (Forces)
Alleviation of data security breach of customer data
6. Applicability
This pattern is applicable in SaaS environment.
7. Structure & Implementation
When end user asks for data.



When end user supply data.



8. Participants
N/A
9. Collaboration
N/A
10. Consequences
a. Increased traffic over network.
b. Additional infrastructure at customer site.
c. Additional implementation of message splitter and aggregator
d. Complex logic at user interface layer.
e. Customer satisfaction


11. Sample Code
N/A
12. Known Uses
To be find out
13. Related Patterns
This pattern is special case of Division of Labour (A-SOA-0001) pattern.
14. Reference
N/A

Download PDF from Scribd

Saturday, May 16, 2009

SOA Pattern - Division of Labour

This first of SOA patterns I like to share.

This Pattern is have named as Division of Labour which essentially states that a service should do what it supposed to do.

Pattern - Division of Labour - V 1.0 Dated May 16 2009

Monday, March 9, 2009

Separation of Service Implementation and Service Interfaces – Service Design Pattern

While analyzing the numerous several services implemented across business domain using various technologies, I observed few that there is clear distinction between neatly designed and messy services. In clean services there has been effort to separate implementation and its interfaces while in not so clean, implementation and interfaces are coupled.

While designing the service most of the time developers have forgotten the concepts of decoupling.

This pattern can be explained in form of picture as:



Monday, February 23, 2009

Service Design Principles

As we all know SOA is an architectural style to building systems from autonomous services. So what are services? Services are software programs that interact with well defined messages over network.

Keeping these propositions in sight, SOA ecosystem robustness and architectural value is greatly influenced by how Services are designed as consumer and provider.

While designing a service one should consider following perspectives:

1. Provider perspective
2. Consumer perspective
3. Implementation perspective
4. Administration perspective

The design goal service should be similar to any software system. These are:

1. Loose coupling: Basic objective of SOA
2. Encapsulation: Basic objective of Object Orientation
3. Polymorphism: Basic objective of Object Orientation
4. Autonomy: Basic objective of SOA and distributed computing
5. Orthogonality: Basic objective concept of layered architecture and Object Orientation
6. Idempotency: Basic concept of distributed computing
7. Cohesion: Division of labour and specialization

So partial list of design and building principles of services:

1. Services should be designed for availability and stability.
a. Once services are deployed in production environment change in their availability & scalability is undesirable
b. Infrastructure support for service should be continually evaluated and updated to cater increased load and stress.
2. Service configurations are designed and built for change
a. With the passage of time and changing business needs, service configurations changes with respect to functional and non functional aspects.
b. Service’s deployment options with respect to physical location, policy, topology changes
3. Service invocations are subject to famous EIGHT fallacies of distributed computing.
4. Use Object based ( programming language - Java objects or XML documents à object/document may represent business event not actual business documents) operation/method parameters and return type
5. Keep service surface area minimum. The more operations/methods a service exposes the more difficult to manage them.
6. Avoid Service Hell
a. Service granularity must be managed. Too coarse grained service hinders re-usability. Too fine grained services create a jungle of services.
b. Service versioning should be managed
7. Adopt pessimistic view while designing a service (consider both views: Provider & Consumer)
a. Design and build services with extensive exception and error framework in foundation.
b. When service acts as provider validate one and all inputs
c. When service acts as consumer design for unreliable provider with respect to availability and performance
8. Services contract should be deployed & versioned independent of:
a. The system they are deployed
b. The inter implementation
9. Idempotency (Repeatability): Service must be idempotent with respect to one and multiple consumers.
10. Service nomenclature should be in sync with business not with development team. This especially true for business services.
11. Services must be stateless.
12. Services should have multiple interfaces either using ESB or without it.
13. Service should support patch like mechanism to facilitate upgrade.
14. Service operations/methods should be designed for concurrency.
15. Carefully decide (use both business and technical perspectives) which service should have compensatory service
16. Avoid transactions
17. To track state during long running service use track identifier at each milestone of process.

Friday, February 6, 2009

Single Service: Multiple Interfaces – Service Design Pattern

In one of my recent project, I encountered an interesting challenge. There was couple of services. Each of these services needs to serve various consumers which have diverse background. Few of the customers were interested in one type of interface (Web Service) while other set of consumers were demanding SOAP over JMS, CORBA calls and few more. This was interesting situation. My SOA instinct told me to look for solution in ESB. But none of ESB was able to provide such diverse channel transformation. Then I discovered that solution lies some where else.

“A service should have multiple interfaces in terms of technology & business needs if ESB fails to provide.”

I realized from analysis of various other projects that this is a pattern which is quite prevalent but not explained in detail. I call this pattern Single Service: Multiple Interfaces.






Discovery of this pattern also leads to another pattern – Separation of Service Implementation and Service Interfaces. I will discuss this pattern in detail in some future post.