Monday, January 3, 2011

Service Oriented Design with Ruby on Rails - An Introduction

by James John

Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development. It was extracted by David Heinemeier Hansson from his work on Basecamp, a project management tool by 37signals which is a web application development company. It is normally installed using RubyGems.

Now let's have a look at service oriented design with RoR.

Service oriented design is generally about creating systems that group functionality around logical functions and business practices. The basic goal of service oriented design is to split up the parts of an application into components that can be emphasized, improved and also fixed without having to test and verify all the other components when an individual is updated. To achieve these goals usually entails a trade-off between complexity and emphasized speed. However it is necessary to segment complex and also large applications into parts that can be tested and deployed separately.

There are many approaches that one can use to design a service-oriented application. The real goal of service-oriented design is to create simple and agile services layers that can be consumed without the use of generators or strict schemas. Service-oriented design can be daunting and complex. It requires more thought up front and decisions about how to separate logic and data in an application. One of the biggest advantages of Rails is the ability to quickly add a few models to an application and see the desired results immediately.

Up-front design and services give developers the ability to build apps that support greater complexity and larger team sizes. Service-oriented systems sacrifice speed for stability, reuse, and robustness. The key to pairing Rails applications with services is to use Rails for its strengths and switch over to services when a more stable approach is required. As parts of an application mature, their interfaces and requirements become more concrete. These are the sections that can gain the most from services. Utilizing services is best for sections of an application that have stable, well-defined, and well-understood requirements.

These are some advantages of using services rather than using a typical monolithic application.

a) Isolation: - Isolation makes a service much easier to manage and optimize. Isolated components can be tested separately from other parts of an application. Robustness, scalability, and improved testing strategies all stem from the concept of isolation.

b) Robustness: - Services are robust because their underlying implementation can change with shifting load requirements, libraries, and languages without damage to the rest of the application.

c) Scalability: - When you are using services, you need to think up front about how to separate data and manage interaction. This partitioning of logic and data provides the ability to scale the size of the code base and team in addition to the number of requests to process.

d) Agility: - To upgrade the underlying system is easier when it comes to services. New versions of existing services and new services can be implemented outside the full design. This can provide much-needed agility for mature code bases where changes are typically expensive to verify with the rest of an application.

e) Interoperability: - Using HTTP-based services is a great way to expose the functionality of legacy applications or external vendors.

f) Reuse:- Service-oriented design enables reuse of components across multiple applications or clients.

These are some of the advantages of service oriented design. Ruby on Rails with service oriented design it becomes much easier for the developer to get the desired results.

About the Author

The author of this article is an expert in custom software development and has also written various articles on web development and web design India in the last five years.