This is the second part in a series of articles about mixing Scala and Spring MVC. In the first post we looked at how to set up a Scala-Java Maven project and we saw how well Spring MVC translates over to Scala in a very simple example. In this post we will continue with our exploration of Spring MVC and Scala by extending our web application that we started on in the previous post so you might want to go get the example code on GitHub so you can follow along.
April 27, 2012
April 18, 2012
Scala + Spring MVC = True?
This is the first part in a series of articles about mixing Scala and Spring MVC. In this post we will start by setting up a Maven project that can handle a Scala-Java mixed project and then we will take a look at a simple example of a web service using both Scala and Spring MVC.
Scala, is a language that has a lot of benefits and some nice characteristics and there are more and more companies that are starting to use it in their production code. Unless you have the privilege to build a brand new system all in Scala, and that new system have no need to integrate with any other code base, you will sooner or later find yourself facing issues around mixing Java and Scala code together if your current systems are written in Java. Spring MVC is a well known framework and is extensively used in a wide variety of applications and chances are you already have a well functioning Spring MVC application. Maybe you also have a lot of infrastructure build around it and integrated to it, like access control and logging for example. And since that infrastructure is written in Java you need to be able to take advantage of those available systems to make the most out of your Scala API.
Ok, so all you need to do is hook up your new shiny Scala API that you have developed. But how do you do it? And does it work? Those are some of the questions that I asked myself and I will try to share some of my findings on the subject here.
Scala, is a language that has a lot of benefits and some nice characteristics and there are more and more companies that are starting to use it in their production code. Unless you have the privilege to build a brand new system all in Scala, and that new system have no need to integrate with any other code base, you will sooner or later find yourself facing issues around mixing Java and Scala code together if your current systems are written in Java. Spring MVC is a well known framework and is extensively used in a wide variety of applications and chances are you already have a well functioning Spring MVC application. Maybe you also have a lot of infrastructure build around it and integrated to it, like access control and logging for example. And since that infrastructure is written in Java you need to be able to take advantage of those available systems to make the most out of your Scala API.
Ok, so all you need to do is hook up your new shiny Scala API that you have developed. But how do you do it? And does it work? Those are some of the questions that I asked myself and I will try to share some of my findings on the subject here.
April 4, 2012
Take your REST API to the next level with HATEOAS
A pragmatic approach to understanding HATEOAS
HATEOAS, or "Hypermedia As The Engine Of Application State", is a lot about the discoverability in a RESTful API. And it is also the part that most REST APIs misses out on. This is sad because there are a lot of benefits to reap if you take your API to the next level. Especially for the developers using your API.Some of the benefits of using HATEOAS include simpler clients, simplified authorization control on the client side, and making your API self-documenting. If you are all new to the concept then Martin Fowler's article on the RESTful maturity model is a good start. To summarize it, the model defines four levels of maturity of the RESTfulness of an API:
- One URI, one HTTP method
- Multiple resources instead of a single endpoint
- Use of HTTP verbs
- Discoverability by using hypermedia
Subscribe to:
Posts (Atom)