Wednesday, May 20, 2009

Web Services - Versioning Practices

Before jumping to versioning of web service, I like to point out that a service has two parts:

1. Implementation: This part may be Java/C#/etc code specifically written for a service under consideration or legacy code & wrapper written over it.
2. Interface: This part is WSDL file in WS* ecosystem or a simple HTML in case of REST world.

Keeping this background in view versioning of a web service can be done at two levels.

1. At implementation level
2. At interface level (This blog entry focuses on WS* complaint web services only. So WSDL versioning will be discussed).

With versioning comes compatibility. Compatibility should be considered from service view as well as consumer.

Compatibility from Service View:

1. Backward compatibility: New version of the service remains compatible with older consumers who were compatible with older version of the service.
2. Forward compatibility: New version of the service remains compatible with future consumers independent of their compatibility with older version of service.

Compatibility from Consumer View:

1. Backward compatibility: Customers of newer version of the service remain compatible with older version of the service.
2. Forward compatibility: Consumers of older version of the service remain compatible with newer version of the service.

Versioning of a service does not emerge from zero. The requirement of versioning of a service emerges due to change in some feature of it. This feature may be due to change in:

1. Functionality
a. Technical – enterprise is changing technology A to B
b. Business – Address Service supplies alternative address in addition of business & home address
2. Quality of service – add one more level of QoS service (existing one are Platinum & Gold; newer one is Bronze)
3. Deployment scenario – change in endpoint, out sourcing of service

These changes can be of following types:

1. Incremental : functionality & features are added to service
2. Decremented: functionality & features are deleted from service
3. Transparent: Consumer do not care about changes. They continue to live in their own cozy world without caring changes in services which they are consuming as they are not affected by changes in the services.
4. New Emergence: New service has arrived in the wild.

An SOA or Service architect has to deal with all of these parameters which can affect service or consumer and which lead to versioning.

The easiest way to handle versioning of the services is to “not to care about it”. Just create a new service every time. This approach seams simple but will lead to the situation where enterprise will host several service which essentially giving same output with slight variation. Consumers are confused; they do not know which service to call. Bloated maintenance and support staff. Ever increasing service portfolio, without significant increase in functionality to be offered via services.

If business users of your organizations are happy and content with case, STOP reading, you do not need to know the details to avoid this mess.

Let us list all possible combinations.



To handle versioning in WSDL there are two approaches

1. Context based
2. Content based

The consolidated list of changes which can occur in WSDL is:

1. Change in the operation/s parameter/s of a Web service.
a. Addition of new input parameter/s (this will affect the current consumers)
b. Change in existing input parameter/s
i. Change in an XML document that might be used as a message parameter in a Web service. The changes in an XML document may involve the addition of optional elements or attributes (this might affect the current consumers) or of mandatory elements (this will affect the current consumers)
ii. Change in data type or order (this will affect the current consumers)
2. Addition of operation/s
3. Deletion of operation/s (this will affect the current consumers if deleted method is under use by any of existing consumer)
4. Change of the name of operation/s (this will affect the current consumers)
5. Change in structure of complex data type
6. Addition/Deletion of elements to existing response message
a. Required elements (this will affect the current consumers)
b. Optional elements (this might affect the current consumers)
So, how to do versioning?

1. Place the version number in the WSDL target name space.



2. Version the import types in WSDL



3. Embed versioning info in the interface (portType) name



4. Embed versioning info in the service name



5. Use UDDI as a Version aware registry
6. Provide one operation per WSDL which returns info about
a. Version of called WSDL
b. Status of current WSDL (deprecated or otherwise)
c. End point of latest WSDL
d. Version of latest WSDL

To handle versioning challenge following patterns can be used

1. Consumer binding pattern
2. Layer of indirection pattern
3. Adapter pattern

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

Sunday, May 17, 2009

Book Review: Applied SOA: Service-Oriented Architecture and Design Strategies

Book Review: Applied SOA: Service-Oriented Architecture and Design Strategies by Michael Rosen, Boris Lublinsky, Kevin T. Smith, Marc J. Balcer: Publisher- Wiley: ISBN- 13: 978-0470223659

As name suggest Applied SOA covers wide array of topics from SOA ecosystem. This book starts with introduction to SOA and then penetrates deep into SOA details. I found this particularly useful due to its practical approach while discussing details of SOA.

Most of the SOA books talks about web services but seldom talk about their implementation and architectural aspects.

Applied SOA is divided into three parts Understanding SOA, Designing SOA and Case Studies. Part one covers basic concepts about SOA, part two covers architectural consideration about SOA ecosystem and last but not least covers two detailed case studies. One case study covers integration using SOA while second talk about general SOA.

The book is a long one, but it is worth the read


Disclaimer
: I did not get paid to review this book, and I do not stand to gain anything if you buy the book. I have no relationship with the publisher or the author.

Further reading
: There are numerous competing books. My list:
1. Service-Oriented Architecture (SOA): Concepts, Technology, and Design by Thomas Erl
2. Service-Oriented Architecture: A Field Guide to Integrating XML and Web Services by Thomas Erl
3. Enterprise SOA: Service-Oriented Architecture Best Practices by Dirk Krafzig, Karl Banke, Dirk Slama

One can get more information about book and related topics from:

1. Amazon USA
2. Amazon UK
3. Publisher – Wiley
4. Interview with Boris and Book Review
5. Book Store for Buyers in India Indiatimes
6. One more book store from India Flipkart
7. At Diesel eBooks
8. Review at BPMInstitute.org

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

Friday, May 8, 2009

Book Review: Practical API Design: Confessions of a Java Framework Architect

Book Review: Practical API Design: Confessions of a Java Framework Architect by Jaroslav Tulach: Publisher- Apress: ISBN- 13: 978-1-4302-0973-7

Before start reading Practical API Design, I googled and not able to find much of stuff on API design. Only worth while to mention are discussion on Artima forum dated 2005 and a paper by Brian Ellis, Jeffrey Stylos, Brad Myers. Certainly Effective Java Joshua Bloch also discusses the topic. I was surprised and started reading the book.

Once I started the book I was hooked to it. This book is written clearly demarcated three parts: Theory, Design aspects and Advice characterized as Theory & Justification, Practical Design and daily Life.

As confessed by Tulach book covers only Java language specifics but still book is must read for non java professionals.

Book primarily focuses on few topics: Evolve-ability, Backward & forward compatibility, architecture by committee and lessons learnt from NetBeans API development.

The book is serious readers and those who like to read book with notebook and pencil. This book is not easy read which you can read during your lunch. It needs serious time and efforts to read and then grasps. It discusses various aspects of API design with respect to backward & forward compatibility, runtime behavior, testability, separation of API & SPI, mingling with other APIs (here certainly I recommend reads to look into Struts 2.x and Grails architecture, design and source, because these frameworks/API uses third party libraries extensively), interface vs. abstract classes etc.

Tulach has recommended not to rewrite because of breaking old loyal clients. Personally, I also subscribed to this line of thought but certainly Struts 2.x violets this line and still very successful. It has to be studied in details.

Though book is comprehensive but it has not covered few topics:

1. Effect of hard coding of SUID (static final long serialVersionUID =xx)
2. Performance
3. How to make API accessible from different programming languages (say C#)

Tulach is maintaining books web presence at http://www.apidesign.org, I hope he will take care of the different views and uncharted topics in future.

I am hoping for similar book by other veterans of industry both open source & proprietary frameworks and APIs (Eclipse, Spring, Hibernate, jUnit, Glassfish, Ant, Struts, Groovy on the Grails) as well as non Java frameworks and APIs (Ruby on the Rails , AspectDNG, Netron graph library, NAnt).

Practical API Design must be in your bookshelf if you are java architects veterans or aspiring one. It is also a good reference book for non java folks as principles discussed are very much applicable in other languages but must be tweaked to adjust with language specifics.

Disclaimer: I did not get paid to review this book, and I do not stand to gain anything if you buy the book. I have no relationship with the publisher or the author.

Further reading: A competing book is Effective Java by Joshua Bloch

One can get more information about book and related topics from:

1. Book’s web presence at http://apidesign.org
2. Purchase book at Amazon
3. Publisher -- Apress
4. Interview with Author
5. Review at 72 Miles
6. 90th Percentile Blog
7. The Factory Pattern in API Design: A Usability Evaluation by Brian Ellis, Jeffrey Stylos, Brad Myers
8. Discussion on API Design
9. Java Language Specification, Chapter 13: Binary Compatibility

Wednesday, May 6, 2009

Random Thoughts about SOA: Part 1

1. Attribute of Successful SOA implementation
  • Rate of increase in Technological Complexity should be less than rate of increase in Business Complexity
  • Continual siloed Changes
  • Conservation of familiarity for technical and business persons
  • Feedback based continuous learning and un-learning
  • Trap business and technical event and then take action
  • Be disruptive as whole but not in incremental fashion.
  • Adhere to Standards for benefits not for sake of adherence

2. Design Operators of “Modular” SOA
  • Splitting: Services can be made independent
  • Substituting: Services can be substitutes and interchanges
  • Excluding: Existing services can be removed to build a usable solution
  • Augmenting: New Services can be added to create new Composite services and/or processes
  • Inverting: Hierarchical and composition dependencies among services can be rearranged ( most difficult)
  • Porting: Called Service is independent of calling service.

3. Lean SOATM
  • Eliminate Waste: Spend time and resources only what add real customer value
  • Amplify Leaning: Tougher the problem, increasing the feedback
  • Decide as Late as Possible: Keep options open as long as practical (not possible)
  • Fail early, fail frequent: Use increment development & deployment
  • Deliver as fast as possible: Deliver value to customer as soon as customer asks
  • Empower the team: People are intelligent, encourage them to contribute
  • Build Integrity: Most of the time, shortest route is not the best route
  • See the Whole: Beware of the temptation to optimize parts at the expense of whole.

Monday, May 4, 2009

My Bookshelf

Languages

1. Thinking in Java by Bruce Eckel
2. Java: The Complete Reference by Herbert Schildt
3. Java™ Virtual Machine Specification by Tim Lindholm, Frank Yellin
4. The Java™ Language Specification by James Gosling, Bill Joy, Guy Steele, Gilad Bracha
5. Inside Java™ 2 Platform Security: Architecture, API Design, and Implementation By Li Gong, Gary Ellison, Mary Dageforde
6. Effective Java by Joshua Bloch
7. Designing Enterprise Applications with the J2EE™ Platform by Inderjeet Singh, Beth Stearns, Mark Johnson
8. Java Trails by Sun
9. Thinking in C++ : Introduction to Standard C++, Volume One by Bruce Eckel
10. Thinking in C++, Volume 2: Practical Programming by Bruce Eckel, Chuck Allison


Computer Science & Software Engineering

11. Practical API Design: Confessions of a Java Framework Architect by Jaroslav Tulach
12. SOA Principles of Service Design by Thomas Erl
13. SOA Design Patterns by Thomas Erl
14. Service-Oriented Architecture (SOA): Concepts, Technology, and Design by Thomas Erl
15. Web Service Contract Design and Versioning for SOA by Thomas Erl, Anish Karmarkar, Priscilla Walmsley, Hugo Haas, L. Umit Yalcinalp, Kevin Liu, David Orchard, Andre Tost, James Pasley
16. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions by Gregor Hohpe, Bobby Woolf
17. Applied SOA: Service-Oriented Architecture and Design Strategies by Michael Rosen, Boris Lublinsky, Kevin T. Smith, Marc J. Balcer
18. UML Distilled: A Brief Guide to the Standard Object Modeling Language by Martin Fowler
19. The Mythical Man-Month: Essays on Software Engineering by Frederick P. Brooks
20. The Practical Guide to Defect Prevention (Best Practices) by Marc McDonald, Robert Musson , Ross Smith
21. Guide to the Business Analysis Body of Knowledge by International Institute of Business Analysis
22. Understanding Open Source & Free Software Licensing by Andrew M. St. Laurent
23. Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides (GoF)
24. Enterprise Integration Patterns by Gregor Hohpe and Bobby Woolf
25. Enterprise Integration Patterns
26. 97 Things Every Software Architect Should Know by Richard Monson-Haefel
27. Pattern Oriented Software Architecture Volume 5: On Patterns and Pattern Languages by Frank Buschmann, Kevlin Henney, Douglas C. Schmidt
28. Enterprise Solution Patterns Using Microsoft .Net: Version 2.0 : Patterns & Practices by Microsoft
29. Cunningham & Cunningham, Inc
30. Patterns of Enterprise Application Architecture by Martin Fowler
31. Project management Body of Knowledge (PMBOK) by Project Management Institute
32. RESTful Web Services by Leonard Richardson, Sam Ruby
33. Code Complete: A Practical Handbook of Software Construction by Steve McConnell
34. Software Estimation: Demystifying the Black Art by Steve McConnell
35. The Pragmatic Programmer: From Journeyman to Master by Andrew Hunt, David Thomas
36. Collective Intelligence in Action by Satnam Alag
37. Rapid Development: Taming Wild Software Schedules by Steve McConnell
38. TOGAF™ Version x -- The Open Group Architecture Framework by The Open Group
39. Software Engineering Institute
40. The Requirements Engineering Handbook by Ralph R. Young
41. Evaluating Software Architectures: Methods and Case Studies by Paul Clements, Rick Kazman, Mark Klein
42. Software Architecture for Product Families: Principles and Practice by Mehdi Jazayeri, A. C. M. Ran, Frank Van Der Linden, Alexander Ran
43. Software Product Lines: Practices and Patterns by Paul Clements, Linda Northrop

Others

44. The world as I see it by Albert Einstein
45. Mein Kampf by Adolf Hitler
46. A Brief History of Time by Stephen Hawking
47. The Art Of War by Sun Tzu
48. Visual & Statistical Thinking: Displays of Evidence for Decision Making by Edward R. Tufte
49. The Visual Display of Quantitative Information by Edward R. Tufte
50. The McKinsey Way by Ethan M. Rasiel
51. Rich Dad, Poor Dad: What the Rich Teach Their Kids About Money --That the Poor and the Middle Class Do Not! by Robert T. Kiyosaki
52. The World is Flat by Thomas Friedman
53. Who Moved My Cheese?: An Amazing Way to Deal with Change in Your Work and in Your Life by Spencer Johnson
54. 7 habits of highly effective people by Stephen R. Covey
55. Blink: The Power of Thinking without Thinking by Malcolm Gladwell
56. Outliers: The Story of Success by Malcolm Gladwell
57. Think!: Why Crucial Decisions Can't Be Made in the Blink of an Eye by by Michael R. LeGault
58. Flatland: A romance of many dimensions by Edwin A. Abbott
59. It Happened in India: The Story of Pantaloons, Big Bazaar, Central and the Great Indian Consumer by Kishore Biyani
60. The Goal: A Process of Ongoing Improvement by Eliyahu M. Goldratt, Jeff Cox
61. Critical Chain: A Business Novel by Eliyahu M. Goldratt
62. Lean Thinking : Banish Waste and Create Wealth in Your Corporation, Revised and Updated by James P. Womack, Daniel T. Jones, Daniel Jones
63. The Machine That Changed the World: The Story of Lean Production-- Toyota's Secret Weapon in the Global Car Wars That Is Now Revolutionizing World Industry by James P. Womack, Daniel T. Jones, Daniel Roos
64. The Toyota Way by Jeffrey Liker
65. Value Stream Management by Don Tapping, Tom Luyster, Tom Shuker
66. Learning to See: Value Stream Mapping to Add Value and Eliminate MUDA by Mike Rother, John Shook
67. Business Process Change, Second Edition: A Guide for Business Managers and BPM and Six Sigma Professionals by Paul Harmon
68. ARIS - Business Process Modeling by August-Wilhelm Scheer


Journal & Magazine

69. The Architecture Journal by Microsoft
70. Quality Progress by American Society of Quality
71. CBDI Journal
72. MIT Technology Review
73. Harvard Business Review
74. McKinsey Quarterly
75. New Scientist
76. Java World