Friday 14 October 2016

Highlights from the Plenary Sessions

Java 8

One of several talks on the magic that is now available via Java 8: Invoke allows us to abstract out a method definition and decide on it at run-time. As an example, imagine three methods that all take the same arguements:

Money doMoney(Trade t, market m)
Trade doTrade(Trade t, market m)
Par doPar(Trade t, market m)

At run-time you have to decide which method to call. So you create an abstracted method that contains the methods in a map

invoke(Key k, Trade t, market m) {
  map.put("m", doMoney)
  map.put("t", doTrade)
  map.put("p", doPar)
  ...
}

Then call the abstracted method. Note there is no need to edit the original methods (as would be the case with reflection).

Multi-threaded nature and parellel streams are great but difficult to get right because of shared mutable state. Hence go for immutable beans:

  • final classes/fields/types
  • use factories instead of constructors

Optional Interface: Prevents methods returning null. Instead of getValue (which can return null), use findValue (which returns actual value or default - never null).

Continuous Delivery

Case study of how they do deployment at LMAX Exchange.

Before they began using continuous deployment, their release cycles went like this:
freeze, release, panic, bug-fix, repeat.

LMAX exchange has 300 booleans hence 2^300 possible states in among 3 million lines-of-code. When he asked the CEO to choose two from speed, stability and features, the answer was stability, twice.

They use subversion with no branching(!), all commits are to the trunk. All commits tested via Jenkins (12,000 tests, 20-30 mins per build). Using a program (Scotty) for deployment (similar to SixDevEnv). Release contains a snapshot of all artefacts and configurations necessary (including firewall rules and load balancing config). Last stage before deployment is a staging area, which has identical hardware and data as production. Staging uses a copy of prod data, with data fields santitised (e.g. "Fred Bloggs" replaced with "First01 Second01").

Sonatype

The average application has 106 components (weblib + comlib?). Many libraries have CVSS advisory vulnerabilities, yet they still get downloaded and built-in. Sonatype plug-in for Eclipse lets you find the status of current and alternative versions and allows you to upgrade. You can set a build failure threshold if, for example CVSS > 5. Also provides a developer-friendly description of the vulnerability.

Serverless Cloud 

Everyone is into the rent-a-server market these days. There is Paas (Platform as a Service; where you rent a server) or Iaas (Infrastructure as a Service; where you rent a data-centre). Now there is FaaS (Functions as a Service), where you rent the server only long enough to run your program and are billed by CPU cycle-time. There are many players:

  • MS Azure Cloud Functions (quite good, actually)
  • AWS Lambda (from Amazon; terrible UI)
  • IBM BlueMix and OpenWhisk
  • Google Cloud Functions (still in beta)
  • Auth0 Webtask (very easy to use)

The demo tracked the output from a temperature sensor as is weaved its way backwards and forwards between several frameworks. Code fragments written mainly in Node.js (MS suppports C#...). No version control so an external repository is recommended.

No comments:

Post a Comment