Friday, 16 October 2015

RESTing In Spring

What is REST?

REpresentational State Transfer or REST, in short, is a kind of web service that deals with transfer of state of resources from one application to another. REST resources can be represented in various forms like JSON, XML, HTML etc. This is one of the few reasons REST has gained popularity in recent years over its traditional sibling, SOAP. While SOAP is heavy weight, action based, REST is lightweight, resource based.

Spring, being one of the popular frameworks, supports REST i.e., we can develop RESTful web services using Spring. Here I will show you following two things:

1. How to create a REST Service using Spring?
2. How to write a REST client using Spring?

Wednesday, 24 December 2014

Partitioning In Spring Batch

Introduction

As in a batch job huge no of records are processed, it faces performance bottlenecks sooner than later. Different performance bottlenecks that can be cited during batch job execution are long execution period, OutOfMemoryError, bad records which abort the job immediately etc. So while writing a real-time batch job, we have to be utmost careful and take these parameters into consideration. That will help us scale up the batch job properly.

Though there are various ways to scale up a batch job, here I shall show you how to scale up a Spring Batch job using local partitioning. Partitioning is a mechanism of dividing a step into multiple threads where each thread executes a chunk of data in parallel. Here original step is called Master while steps that execute through threads are called Slaves. Some programmers refer to it as Master-Slave approach. Again partitioning can be of two types, local and remote. Remote partitioning is beyond the scope of today's discussion.

Friday, 12 December 2014

Springing Into Batch Job

Spring Batch

A batch job is a software job that processes large volume of data or records in a short span of time without any human intervention. As such batch job plays a crucial role in the functioning of many big enterprise applications. Batch job is there in the software industry since the beginning and I am sure it will be there till the end. Some examples of batch jobs are indexing files, updating the inventory catalog for an online store etc.

Spring Batch is a module of popular Spring Framework which enables writing batch applications / jobs easily and in an effective manner. Before Spring Batch hit the market in the year 2007, industry heavyweights used to write batch applications using their own proprietary technologies and legacy frameworks. Apart from defining the standard, Spring Batch provided some ready-to-use components and all the advantages of Spring framework like POJO, dependency injections etc. to write complex batch applications.

Tuesday, 2 July 2013

JQGrid Using Spring MVC

JQGrid

JQGrid stands for JQuery Grid. It is a grid plugin for the JQuery Javascript library that provides solutions for representing and manipulating tabular data on the web. It is Ajax enabled and accepts XML / JSON / local array data sources. In-place cell editing or on-the-fly form creation to edit a record can be achieved with ease through JQGrid.
Today I will show you how to create a JQGrid in a JSP that will display various students data and how to manipulate these data using Spring and Hibernate. Also JQGrid data validation and pagination part are taken care of in this example.

Monday, 14 January 2013

TopLink Without JPA

What is TopLink?

TopLink is an ORM(object relational management) framework for Java. Like the other popular framework Hibernate, using TopLink we can map Java objects to database entities or tables and can do various persistent operations. Also we can convert Java objects into XML objects. It is a product from Oracle Corporation. In 2007, Oracle donated the source code to Eclipse Foundation and the project EclipseLink was born. EclipseLink is the reference implementation for the Java Persistence API (JPA).