Adding custom HTML attributes to your AngularJS web app

AngularJS is an excellent JavaScript web framework offering so-called “directives” to ‘teach’ HTML some new tricks. Examples of built-in AngularJS directives are:

  • “ngView”: defines the placeholder for rending views
  • “ngModel”: binds scope properties to “input”, “select” and “text” elements
  • “ngShow” / “ngDisabled”: for showing or disabling an element based on the result of an expressions

Continue reading

Gradle Goodness: Distribute Custom Gradle in Our Company

The Gradle wrapper allows us to let developers use Gradle without the need for every developer to install Gradle. We can add the output of the Gradle wrapper task to version control. Developers only need to checkout the source for a project and invoke the gradlew or gradlew.bat scripts. The scripts will look for a Gradle distribution and download it to the local computer of a developer. We can customize the Gradle wrapper and provide a different source for the Gradle distribution. Continue reading

Groovy Goodness: Pretty Print XML

The easiest way to pretty print an XML structure is with the XmlUtil class. The class has a serialize() method which is overloaded for several parameter types like String, GPathResult and Node. We can pass an OutputSteam or Writer object as argument to write the pretty formatted XML to. If we don’t specify these the serialize() method return a String value.

Continue reading

Gradle Goodness: Task Output Annotations Create Directory Automatically

One of the great features of Gradle is incremental build support. With incremental build support a task is only executed if it is really necessary. For example if a task generates files and the files have not changed than Gradle can skip the task. This speeds up the build process, which is good. If we write our own tasks we can use annotations for properties and methods to make them behave correctly for incremental build support. The @OutputDirectory annotation for example can be used for a property or method that defines a directory that is used by the task to put files in. Continue reading

Gradle Goodness: Init Script for Adding Extra Plugins to Existing Projects

Gradle is very flexible. One of the ways to alter the build configuration is with initialization or init scripts. These are like other Gradle scripts but are executed before the build. We can use different ways to add the init script to a build. For example we can use the command-line option -I or --init-script, place the script in the init.d directory of our GRADLE_HOME directory or USER_HOME/.gradle directory or place a file init.gradle in our USER_HOME/.gradle directory.

Continue reading

Gradle Goodness: Running Java Applications from External Dependency

With Gradle we can execute Java applications using the JavaExec task or the javaexec() method. If we want to run Java code from an external dependency we must first pull in the dependency with the Java application code. The best way to do this is to create a new dependency configuration. When we configure a task with type JavaExec we can set the classpath to the external dependency. Notice we cannot use the buildscript{} script block to set the classpath. A JavaExec task will fork a new Java process so any classpath settings via buildscript{} are ignored.

Continue reading

A introduction to websockets.

To make a long story short websockets allow us to create a pipeline between a web client and a server. Which is great because we can push and pull all kind of data through it. This in turn allows us to create highly responsive web applications that may update information over multiple sessions.

Sound awesome doesn’t it. There’s just one catch, and you can probably guess what it is. Continue reading

Day two of the SpringOne 2GX in Washington.

It was a full day starting with breakfast and 5 one and a half hour long presentations followed by dinner and a keynote delivered by Adrian Colyer, CTO of SpringSource.

The keynote was on how application architecture has evolved over the last 10 years towards what it has become today. We started out with a static frontend client that communicated with a service layer, which in turn persisted to a database. Nowadays we have rich clients, multiple services in our service tier that in turn connect to services, websockets and/or other data sources.

Continue reading

Keynote SpringOne 2GX

Juergen Hoeller
Hoeller begint zijn presentatie met de originele driehoek van spring. Zijn verhaal beschrijft vervolgens de transitie die het framework heeft gemaakt sinds dat model naar een annotation framework. Hij legt de nadruk vooral ook bij de beschrijvende namen van de annotaties, en hoe ze zorgvuldig zijn gekozen om de code leesbaarder te maken.

Hierbij gaat hij dieper in op een aantalannotaties zoals stereotypes, injections en ook parameter annotaties. Hierbij geeft hij aan het gevoel te hebben dat de kracht van deze annotaties nog steeds wel onderschat wordt.

Continue reading