Posted by: Ivko | February 14, 2010

Choice of the week – 06/2010

This is the week of the web services (both kinds) articles. And some hard skills for dessert.

Comparing JAX-RS and Spring MVC

Before going into details about the above article, I would give you a short introduction in the abbreviations you see. JAX-RS stands for Java API for RESTful Web Services. This API provides standard interfaces (or rather annotations) that turns your POJO class into a RESTful application. This REST abbreviation stands for REpresantational State Transfer. As opposed to the standard web services, which are more thought as providing some remote functions to be called, the REST services build on the paradigm of providing resources, that have a path in the form of a URI (or URL), they have a type (the HTTP mime types – XML, text, HTML, PDF, etc.). As REST is carried by the HTTP protocol, the web service’s functions are annotated and correspond to the four HTTP request types – get, put, post, delete. So, the web service that you develop live in a container that supports the REST protocol (Jersey is the reference implementation and is part of Glassfish v3). The web service annotates its methods with one of the annotations representing HTTP request type and also indicates to which URL it responds. Usually, the latter is a relative path following the hosting server address. When the server receives a request for a path, it dispatches it to the corresponding web service method. For more information, you can search for the various resources in Internet.

Spring MVC is Springsource’s Model-View-Controller technology. Its main job is provide easy to use way for our web applications to handle incoming requests, invoke the appropriate business logic and based on that build the response. In Spring 3.0 this is easier more than ever. It is achieved with minimal configurations, most of which is part of the class definitions in the form of annotations. Another thing in the latest version is that Spring controllers are REST-oriented: each of them maps to a specific path in the URL, each if its methods correspond to a specific request type and sub-path of the original type.

If you were not familiar with these technologies, then it would be great to read something about them, as especially JAX-RS and REST are getting momentum right now. If you already know the basics, then the article is for you. The author does not actually try to compare them and judge which is the better one. He rather shows how a technology like Spring MVC, that was initially designed for web application development, can be used as a JAX-RS container. It supports most of the specification’s common features. Very interesting article by the fellow Bulgarian blogger, who BTW works for Springsource😉.

Introducing CXF

Apache CXF is a web services framework built by the Apache Software Foundation. It supports both types of web services – JAX-WS (including most of the standards under its umbrella) and JAX-RS. It can both create java classes from WSDL files and vice versa.

The IBM developer works article is third in a series presenting web service frameworks. The author compares Apache CXF to Axis2 (again from Apache) and to Metro (from Sun). He shows later on how you can create a simple web service (the server and the client side) for searching a book library. This very same sample was built in the previous two installments of the series with the other two web service stacks.

Introduction to JAX-RS with Jersey

This article is for those of you who have a vague understanding of what RESTful web services are, but have no experience with implementing those in Java. The author does not really go into details about how REST works, what do the different annotations mean, etc. He puts more emphasis on how to pack and access your POJOs in a server that used Jersey (the reference implementation for JAX-RS).

Glassfish v3 is chosen as an app server, though it is not obligatory. When you install it, you get Jersey for free. By reading the article, you will find in great detail how to configure the web.xml, how to deploy the war file, and then how to access it. It is also accompanied with fistful of screenshots.

Are you a software architect?

The role of the software architect is assumed to be taken by the most experienced developers in the team. However, is that the only thing that the architect  should possess – experience?

According to the author, the architecture process can be broken into two phases: architecture definition and architecture delivery. These two phases are additionally broken down into five elements each. All these elements are discussed in details. Read on and answer the question: Are you a software architect?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: