javacodegeeks.com

Java Lambda Streams and Groovy Clouses Comparisons

This Blog post will look at some proverbial operations on List data structure and make some comparison between Java 8/9 and Groovy syntax.So firstly, the data structure.  It’s just a simple Rugby player who has name and a rating.Javaclass RugbyPlayer { private String name; private Integer rating; RugbyPlayer(String name, Integer rating) { this.name = name; this.rating = rating; } public String toString() { return name + "," + rating; } public String

javacodegeeks.com

Scala Syntax: 7 points

A few years back I dipped into some Scala as a hobby language. But, one aspect I found challenging was just getting my head around Scala syntax again. Some of it, yeah the basic stuff can be counter intuitive depending on your perspective.1. Method / Function DefinitionTyping on the right rather than the left. Consider this simple function definition:def sayHello(param: String): String = { "Hello" + param }Javaholics will note:The

javacodegeeks.com

And some more REST tips

In previous blog posts I have covered some ideas and tips for achieving a REST architecture. In this post, I cover a few more ideas and tips.CachingCaching is a big part of the original dissertation.  See section 5.1.4 Strategies include validation (client checks it has the latest version) and expiration (client assumes it has the latest version until a specified time)Expiration:Expires header tells client when

javacodegeeks.com

REST: Using a Controller endpoint?

In general REST architectures, the fundamental concept is a Resource.  After Resources, the next thing is to develop a Uniform Interface to these resources, which in HTTP land usually means:Create is POSTRead is GETUpdate is PUT (or PATCH for Partial Update)Delete is DELETEIn the real world, inevitably some operations won’t map so nicely to resources. This is usually a minority of operations for example reset password.