GUI webapp

Reusing front-end components in web applications

In the Java SE realm, GUI components are based on Java classes with the help of libraries such as AWT, Swing or the newer JavaFX. As such, they can be shared across projects, to be inherited and composed. Things are entirely different in the Java EE world, as GUI components are completely heterogeneous in nature: they may include static HTML pages, JavaScript files, stylesheets, images, Java Server Pages or Java Server Faces. Solutions to share these resources must be tailored to each type. Si

angularjs

Doubly geeky stuff: AngularJS meets Marvel comics

Let’s face it: despite us having very serious titles like Principal Consultant, Senior Software Architect or Team Leader, most of us are geeks through and through. Each shows it in a different way; some fiddle with machines, some like cosplay, me I like comic books. When I learned that Marvel Comics provided a developers REST API, I couldn’t resist playing with it. I’m more of a backend guy, and though I love Vaadin, using it to call REST services would be like proxying with n

collections

Extrinsic vs intrinsic equality

The following article is purely theoretical. I don’t know if it fits a real-life use-case, but the point is just too good to miss :-) Java’s List sorting has two flavors: one follows the natural ordering of collection objects, the other requires an external comparator. In the first case, Java assumes objects are naturally ordered. From a code point of view, this means types of objects in the list must implement the Comparable interface. For example, such is the case for String

css javascript optimization webjars wro4j

WebJars and wro4j integration

WebJars is an easy way for server-side developers (such as your humble servant) to manage client-side resources such as Bootstrap, jQuery and their like, within the same package management tool they use for their server-side libraries. In essence, what WebJars does is package a set version of the client-side resource (CSS or JavaScript) in the META-INF/resources of a JAR and upload it on Maven Central. Then, any Java EE compatible web-container makes the resource available under a static URL. F

dependency guava

Guava is an heavyweight library and I would like this to change

Google Guava is an useful library that offers many different but unrelated features: For my Vaadin projects, I like using Event Bus to promote loose coupling along my componentsGuava offers Functional oriented collections handlingThere’s a lightweight Cache implementationetc. However, this article is not about those features but about offering a single heavyweight Uber JAR for all. From Google’s point-of-view, providing an Uber library for all projects makes sense: 'Hey guys, just a

JavaFX

Spreading some JavaFX love

I’m not a big fan of JavaFX: version 1 was just a huge failure, and investing in fat-client architecture in 2013 is either because you have very specific needs or are completely out of your mind. Nevertheless, I wanted to write about fat-client testing in Integration testing from the trenches, and JavaFX is the Java way for fat-client GUI. So I was searching for some easily available application I could take as an example when I stumbled upon the Ensemble samples project from Oracle itsel

javaconfig spring

Integrate Spring JavaConfig with legacy configuration

The application I’m working on now uses Spring both by parsing for XML Spring configuration files in pre-determined locations and by scanning annotations-based autowiring. I’ve already stated my stance on autowiring previously, this article only concerns itself on how I could use Spring JavaConfig without migrating the whole existing codebase in a single big refactoring. This is easily achieved by scanning the package where the JavaConfig class is located in the legacy Spring XML conf