Significant Birthdays for STEM Nerds

An old photo, probably from the 60s, of a nerdy looking boy blowing out the candles on a birthday cakeMost people consider the following to be significant birthdays:

1, 10, 18, 21, 30, 40, 50, 60, 70, 80, 90, 100, 101, 102, 103, 104, 105, …

As a self-identifying STEM nerd, I find the following list of significant birthdays much more interesting…

1, 2, 3, 4, 5, 8, 9, 13, 16, 18, 21, 25, 32, 34, 36, 49, 55, 64, 81, 89, 100, 121, 128, …

128 is my stretch goal. 🙂

(WIN! If you’re the first person to post the next ten numbers in the sequence in a comment, you’ll win a free warm fuzzy feeling of being the first person to post the next ten numbers in the sequence.)

Image credit: ‘BLOWING THE CANDLES2‘ by David Zellaby

Two REST tips for tackling tricky resource examples

After my post a couple of days ago about the first thing you should know about REST, a friend emailed me with this feedback:

Nice post. It was something I was thinking about just recently and I think I’m guilty of making these mistakes. The example which confused me was verifying a password. I wasn’t sure what HTTP method to use or what the resource was. The request needs to contain a password but doesn’t expect any response other than a 200, does this mean GET is inappropriate?  It doesn’t update anything, unless of course it fails in which case it may update a failed login counter or lock the account. Does this rule out PUT and POST?

Young man in a very uncomfortable hammock, trying hard to pretend to have a REST.Here’s the response I sent him (fleshed out with a little more detail for this blog)…

REST can be easy and REST can be hard

Yep, the examples in my blog were the easy ones. Plenty of hard ones will crop up, where the resource on the server you want to manipulate is not immediately obvious, like the one you’ve pointed out, or where coming up with a good set of URL patterns is not straightforward. As with all things that aren’t easy, spending some extra time on it is usually worth the effort.

Think like a REST Server

I think what can help is to try and think less about what the client is doing (“verifying a password”) and more about what’s happening on the server side. Continue reading

Do you even know the first thing about REST?

A sign saying 'REST AREA', with an arrow pointing up and to the right.It’s not unusual to see examples where people think they are “doing REST”, but are not. A lot of people are trying to use simple web technologies in their microservice architectures, but I suspect there’s a prevalent idea that if you are using HTTP and sending JSON back and forth, you’re doing REST, which is simply not the case. (We’re talking about the Representational State Transfer style of software architecture here, in case you’re lost.)

Spring’s REST

Spring’s Web MVC Framework documentation says in the first paragraph: “With the introduction of Spring 3.0, the @Controller mechanism also allows you to create RESTful Web sites and applications…” Further on, introducing its @RestController interface, it says: “It’s a very common use case to have Controllers implement a REST API, thus serving only JSON, XML or custom MediaType content.” So, does creating a web service using a @RestController-annotated class magically make it a RESTful service?
No. Such no.

Not so REST

The big thing I see developers getting wrong when trying to use web technologies for inter-service communication is that they continue to think about operations. Continue reading

Notes from YOW! 2014: Gojko Adzic on ‘Make Impacts, Not Software’

I attended YOW! Sydney 2014 and thought some people might get something useful out of my notes. These aren’t my complete reinterpretations of every slide, but just things I jotted down that I thought were interesting enough to remember or look into further.

Gojko Adzic (@gojkoadzic) spoke about the trouble of aligning strategy and the desired impacts of projects with the implementation of the software.

Palchinsky Principles

An ant carrying a leaf. Ants are known to carry far more than their own weight, a great example of having a big impact.He spent some time discussing the Palchinsky principles, from Russian engineer Peter Palchinsky as documented in Tim Harford’s book ‘Adapt’.

The principles, intended to guide the development of innovations, are:

  1. Variation: We should seek out new ideas and try new things.
  2. Survivability: We should do things on a scale where failure is survivable. (This is why stories should be small. Not so that we can finish them in an iteration, but because they might be wrong.)
  3. Selection: We should seek out feedback and learn from mistakes.

Continue reading