Use the decorator pattern for clean I/O boundaries

There’s a pattern that I keep recommending to teams over and over again, because it helps separate concerns around I/O; sending and receiving things over a network, interacting with AWS, saving and loading things from data stores. It’s an old idea; you’ll find it filed under “Decorator” in your Gang of Four book.

For our purposes here, this is a compositional pattern that allows us to stack onion-rings of concern around an I/O boundary; strings on the wire, transfer protocols (eg HTTP) , formats (eg JSON), business concepts. There is no code in existence that should be concerned about more than one of these at once; they can be structured as stackable layers, and other modules can pick which level of detail they wish to talk to.

Continue reading

Making Scala and functional programming more accessible in REA

In REA, we have a list of highly sought after internal courses available on various topics including AWS, Docker and Elasticsearch. On 7th and 8th May 2018, we added Scala to the list, with over 20 people attending!

How did this all start?

Scala and functional programming have always had some mystique surrounding it. There is this idea that it is too hard or not pragmatic enough. Existing courses are very technical and many people including myself have struggled to complete them.

Continue reading

Using Elasticsearch field collapsing to group related search results

Realestate “Developer Projects” are an important feature offered by REA to our customers (i.e. realestate agencies and property developers). An agency is able to use projects to group related listings so that they are displayed together as a group in our search results.  To implement this feature, we have chosen to use Elasticsearch’s support for  “field collapsing”.

The remainder of this article includes a summary of the problem, the approaches considered, and a bit more detail on the chosen approach.
Continue reading

React Training is Coming to Melbourne

We have been busily re-building our core property listings experience using ReactJS for a while now. After the release of our revamped sold property section, we decided to find a way to engage the other areas of the company and give back to the local tech community.

With that in mind, REA Group is very excited to announce that on the 8th – 10th February 2017 we will be hosting a ReactJS workshop run by the amazing React Training team. React Training is a US based group comprised of ReactJS experts and the creators of some of the most popular open source libraries in the space, many of which we use here.

REA and React Training

Continue reading

Functions as Child Components and Higher Order Components

I have recently been on a Higher Order Component (HOC) craze. HOCs are a good tool for implementing cross-cutting concerns or common functionalities, such as logging and tracking. For more information on HOCs, check out this recent post by my colleague Mehdi Mollaverdi!

Then I discovered Functions as Child Components (FaCC) and a couple of my brain cells perished. FaCC’s are components that receive a function as their child. For example:

So let’s take a trip through struggle town.

Continue reading