Grails – RESTful Webservice using JAX-RS plugin

I discussed about RESTful architecture consideration and how to build RESTful web services using Jersey JAX-RS [JSR 311]  in JAVA. Today I am going to discuss how to build the RESTful web services using Grails framework.

GRAILs framework is the platform which provides end to end solution to build web application from scratch to advance intuitive RIA web application. Grails potentially be a one-stop shop for all your enterprise application development. Grails is modular, allowing you to pick and choose which modules are applicable for your application Continue reading

Advertisements

REST – Representational State Transfer

REST comes from Roy Fielding’s PhD paper, published in 2000, and it stands for Representational state Transfer. REST is set of architectural constrains which can apply on application design to make application more scalable, flexible, reusable, loose couple and align to business agile. Fielding’s REST guideline defines the specific role for data, component, operation, communication protocols, data consumer and producer.

REST is generic constraints for distributed technologies with no limits of technologies or stack.

Following are the constraints that define a RESTful system.

  • Should be for distributed system
  • Data communication should be stateless
  • Request should be independent and reusable
  • It has to support caching.
  • System should be access uniformly accessible
  • Desperate representation of  response
  • Standardize operations

These are independent of technology and represents how data communicate between and what’s guideline need to follow during data transfer between distributed systems.

e.g. Static web is RESTful as it follows fielding’s key guideline on REST. For instance, the existing static web  provide caching, stateless connection, the unique link to resources (HTML). On the other hand, traditional dynamic web applications haven’t always been RESTful, because they typically break some of the outlined constraints. For instance most dynamic application is not stateless.

But we can use abstraction on dynamic system that makes a RESTful system using HTTP protocols, URIs, representation and resources.

Agile methodology

Introduction

Waterfall model follows application development in phases with checkpoint and deliverable documents in each checkpoint. It advocates rigours project management, strategy and processes to track the status. The main drawback is that it require more than 80% project understanding before kick off the project which is impossible in major cases. Cause of volatile requirements and understanding business feels, 80% of software projects using this methodology fail to meet their objectives. Continue reading

Canonical Data Source

When we define SOA strategies at an enterprise level, we deal with multiple Line of Business (LOB) systems; some of them will be dealing with the same kind of business entity as well. This necessitates a Common Data Model (CDM) or Canonical Data Model.

SOA creates an environment where different types of data must work together. This makes application development complex. Service Data Object (SDO) provides a very simple programming model that addresses this issue. The key high level advantages of SDO are:

  • Uniform access to data from heterogeneous sources which could be XML, RDB, POJO, SOAP, etc.
  • SDO provides both a static (or strongly typed) programming model and a dynamic (or loosely typed) programming model. This provides a simple programming model without sacrificing the dynamic model needed by tools and frameworks.
  • Provides Meta-data for easy introspection of data types
  • Supports a disconnected model, whereby data can be retrieved from a data source via Data Access Service. The data can be modified by a client with change tracking, and applied back to the data source.
  • SDO programming model is language neutral

Hetrogeneous Data Source

 

References

Improve Performance by caching and compression

Web page designs are becoming innovative with rich interface which involve extra code such as java scripts, css, and images etc. Most of the end-user response time tied-up in downloading these components.Optimizations of number of http requests and response size are the key parameters to improve the web application performance. Continue reading