Why I Like Spring III
If it’s not yet obvious, I’m a big fan of Spring, especially how easy Spring Boot works with Docker, since you can essentially take your war file & almost run it like an executable, it makes life so, so easy. I won’t make this post too long, I’m tired, you’re probably tired & I’ve already written two other articles about why Spring rocks.
Spring is quite beautiful in the way it encourages clean architecture, personally I LOVE the resource, service & repository oriented architecture. I mean obviously this style of architecture may not work for all applications out there, but for most REST API’s I think it’s fair to say it’s hard to go wrong.
If you look at this example that I’ve forked on Git, you can see just how easy it is, no need to worry about an application server, no need to worry about files such as
or other files like the
file. In this specific example if you want to use a different port or specify a context path, you just update the pom file, specifically by tinkering with the
, it’s that simple.
One thing that I worship about this solution exactly is that it’s not tying you into a specific vendor, yes it does use Jetty, but looking at documentation, to implement this solution with say Tomcat, it wouldn’t be all that different. In the repository that I’ve shared, personally I love that solution as I’m a big fan of JAX-RS, I just love the syntax & I’ve been using it for a couple of years now. Not to mention that this solution even illustrates how you can embed a database into the application.
However, while I do love Spring, I have decided to being looking into alternative technologies also, I simply don’t want to tie myself down to one framework & who knows, it may make me a better all round developer. I’ve specifically taken an interest in Quarkus, since it’s meant to be optimal for containerisation, specifically branded as “Supersonic Subatomic Java“.