Sunday, 24 November 2013

What's the difference between Aggregation and Composition?

I've based this article heavily on information found in Wikipedia[1]. For more information, have a look there.
association
a family of links to different classes. For example: person-address
aggregation
a specific kind of association between only two classes, parts can belong together but are things of themselves. For example: duck-pond, person-room
composition
a specific kind of association between only two classes, but stronger than an aggregation, parent-child relationship, child cannot exist without the parent. For example: car-steeringwheel/house-room
dependency
a weak relationship, which indicates that one class depends on another because it uses it at some point in time. One class depends on another if the independent class is a parameter variable or local variable of a method of the dependent class. This is different from an association, where an attribute of the dependent class is an instance of the independent class. For example: AuthenticationService-User

Note

In the Real World™ a car engine is part of a car, and if the car is scrapped (destroyed), so is the engine. In the realm of Software or Databases, it is often the case that an engine is suitable for more than one model car. So, matters are never black and white.[1]

References

[1] Wikipedia - Class diagram
http://en.wikipedia.org/wiki/Class_diagram

Saturday, 9 November 2013

JFall 2013

I went to JFall 2013, the annual Dutch Java Conference, organised by the NLJUG on Wednesday, the 6th of November 2013 in Nijkerk, the Netherlands.

I found the Keynotes to be singularly exciting, a lot better compared to last year.

Main change was the main sponsor, ING, who have some interesting requirements for their software and who have undergone a change
from the traditional way of developing software to the DevOps way.

My chosen schedule:
  • Shootout! Template engines on the JVM (Jeroen Reijn)
  • Retro Gaming with Lambdas (Stephen Chin)
  • Code-driven introduction to the Java EE 7 Platform (Arun Gupta)
  • Hands-On Labs: Gradle (Mr. Haki)
  • Scratching the Surface with JavaFX (James Weaver)
  • ING Beleggen: how top quality software and state-of-the-art technology leads to continuous delivery (Jos Klompe)

I managed, according to my colleague, to miss out on the talk by Allard Buijze called 'Reactive applications: ready for the future'. But, if all is well, I should be able to view it at Parleys.com.

I hear the talk 'On the integrity of data in Java Applications' (Lucas Jellema) was also really good, that I didn't visit. There's only 24 hours in a day.

Shootout! Template engines on the JVM


The presentation was provided by Jeroen Reijn of Hippo (the Java CMS). He mentioned a few old Template engines, JSP, Freemarker and Velocity. Hippo seems to make use of Freemarker, at least at the moment.

Then he went into some (relatively) new Template engines with included benchmarks:
  • Thymeleaf (web+spring mvc+large memory footprint, a little slow)

    Has Natural Templating, which means that additional namespaces in the XHTML will cause the xhtml pages to render on a normal browser. (It just ignores the additional namespaces).

    Benchmark: 25,000 requests took 30 sec.
    For whom: html designers
  • Mustache (not just web+spring mvc addon)

    Logic-less, so they claim, has no control statements (if, for, while, else, etc). Called Mustache because Expressions are written between double curly brackets ({{), and those look like a mustache.

    Good IDE support.

    Benchmark: 25,000 requests took 12/13 sec.
    For whom: html designers
  • Jade (web)

    A Node.js based template engine. Indentation is part of the syntax, which means there's no need for closing tags. It's minimal, easy to read and small.

    Good IDE support.

    Benchmark: 25,000 requests took 20 sec.
    For whom: java developers
  • Scalate (Scala Template Engine, very slow due to the layout mechanism)

    Scala based, integrates well into Spring, Play, Lift, etc. Supports multiple template languages. The one language Jeroen went into deeper detail about is called SCAML.

    Benchmark: 25,000 requests took 100 sec.
    For whom: Scala enthousiasts

For the java developers that feel the need, the need for speed, stick to JSP and Freemarker.

Retro Gaming with Lambdas


Stephen Chen provided both an overview of lambdas in Java 8 and a practical example in the form of a JavaFX game called 'MaryHadALittleLambda'.

The latter part of which is available on github at https://github.com/steveonjava/MaryHadALittleLambda.

He talked about
  • lambdas
  • extension methods
  • the hamburger operator
  • method references
  • @FunctionalInterface

Code-driven introduction to the Java EE 7 Platform


It was given by the Arun Gupta. I was quite surprised to learn that he's been an employee of JBoss for the past three weeks.

I'm also still not used to the fact that their JBoss Application Server is now called ... Wildfly.

He did a quick code-driven introduction in the following topics:
  • WebSocket (URLs start with 'ws://')
  • JAX-RS (JS339)
  • JSON Client Api
  • Batch
  • JMS

JEE 7 samples are available at his github account at https://github.com/arun-gupta/javaee7-samples.

Hands-On Labs: Gradle


Gradle is sort of like Maven only with a Groovy DSL instead of XML and is more flexible than Maven. Where Maven required selfmade Plugins to get it to do the things you want, Gradle can just be adapted.

From what I hear it is quite easy, even automatic, to convert Maven build scripts into Gradle build scripts.

It seems that NetBeans has builtin support for Gradle, no plugins required. I gotta check that out!

Gradle helps in building a Project. The project consists of tasks. A task consists of actions.

The Lab was one of the easiest and simplest to do. I could have just as easily done that at home.

Scratching the Surface with JavaFX


I enjoyed the presentation of Jim (James) Weaver immensely. It started off with a Dutch Music Guessing Game to break the ice, presumably. After that he showed us the touch events interface in JavaFX. Then proceeded to dazzle us with simple 3D in JavaFX3D.

We should check out iotcommunity.net, and I should mention in JIRA that I want to have shadows from lightnodes.

JavaFX Ensemble application is very nice, as a starting point on what JavaFX makes possible.

Currently, there is some 'unofficial' versions of JavaFX that run on Android and IOS. Expect more news on this.

JavaFX can be lay outed by means of CSS. CSS is a good way to make it more 'finger friendly'. We're talking about touch screens after all.

The 3d parts showed things like shapes (ball, cube, triangle mesh, textures, bump maps), lights (ambient and directional), cameras.

One of the more awesome parts of the presentation was the fact that he wanted to play the guitar, when he was away from home, but without dragging his guitar along. So he programmed touch sensitive guitar strings in 3d on his Microsoft Touchpad. He could play quite well and it was very impressive to see a really good demo of all the touch events he had been talking about.

ING Beleggen: how top quality software and state-of-the-art technology leads to continuous delivery


Jos Klompe and his colleague provided a riveting and energizing talk about what they do for ING, to be specific the portal that customers and employees use to trade stocks and other, more complex, financial instruments.

The most interesting in the story is the complete turnaround from a Bank with a traditional waterfall model over to a dynamic Bank using Agile and Scrum and DevOps teams that is putting IT at the core of its business.