Articles for the ‘Development’ Category
Thursday, February 28th, 2019
Writing our manifest files for Kubernetes / Openshift often forces us to edit xml, json and yml files by hand.
A new library, ap4k allows to specify metadata for these manifest files directly in our Java code using annotations.
In the following short example I am going to demonstrate how to generate manifest files using Maven and ap4k.
(more…)
Tags: annotation, ap4k, aws, azure, container, docker, kubernetes, manifest, monitor, mounts, openshift, prometheus, s2i, tools, volumes
Posted in Development, Java | 1 Comment »
Sunday, May 27th, 2018
Every software project includes a set of architecture decisions defining boundaries and constraints for further design and implementation.
It’s important to document those decisions somehow or else a development team might not know which decisions where made and with which assumptions.
Or they know the decision but are missing the context and the consequences and therefore decisions are blindly accepted or blindly changed.
In the following short tutorial I will show how to structure architecture decisions in so called Architecture Decision Records and how to manage them with a simple tool named ADR-Tools.
(more…)
Tags: adr, adr-tools, agile, architecture, architecture-decision-record, docs, documentation, dot, graph, graphviz, markdown, software-architecture, tracability
Posted in Development, Enterprise | No Comments »
Wednesday, November 9th, 2016
Setting up a larger application using dependency injection always requires us developers to set up our application’s object graph.
Programming in Go there is a library that eases this task for us, offering a reflect based injector to set up the graph in a few steps, named facebookgo-inject.
In the following article I’d like to demonstrate dependency injection using this library for a small sample application.
(more…)
Tags: dependency injection, di, facebook, facebookgo, go, golang, IoC
Posted in Development | No Comments »
Saturday, October 29th, 2016
Learning the Go programming language, I wanted to implement an application that I had written with other languages and frameworks before to get a grip on this language.
That’s why I tried to implement a really simple websocket chat server in Go and described my approach in the following article.
(more…)
Tags: chat, go, golang, html5, package, websocket
Posted in Development | 2 Comments »
Friday, July 1st, 2016
Atlassian has added a continuous integration service as a new feature to their Bitbucket Cloud product. It’s called Bitbucket Pipelines and it is similar to Travis CI for GitHub offering a nice integration for continuous integration/delivery pipelines for projects hosted on Bitbucket.
It’s still in the beta phase and requires a sign-up but nevertheless I’d like to demonstrate the current state of this service and how easy it is to add scripted pipelines to a project.
(more…)
Tags: Atlassian, bitbucket, cd, ci, cloud, continuous delivery, continuous deployment, continuous integration, docker, dockerhub, gradle, integration, jira, pipeline, test, vert.x, vertx, yaml
Posted in Development, testing | No Comments »
Tuesday, August 18th, 2015
HipChat is Atlassian’s alternative to Slack and its solution to team collaboration chats. Atlassian Connect offers developer tools to bootstrap applications, connect to Atlassian’s cloud products with easy and in combination with HipChat’s REST APIs allows us to write integrations for such a chat server in no time.
In the following tutorial I’d like to show how to write an integration within a few steps using Atlassian Connect, Node.js and Express and how to connect the integration to a HipChat server.
Finally on the one hand I’m going to explain how to speed up local development with ngrok, an in-memory database and nodemon for automatic application restarts and on the other hand I’m going to demonstrate how to configure the application for production, running with a Redis key-value store on Heroku.
(more…)
Tags: Atlassian, atlassian-connect, chat, database, db, express, heroku, hipchat, inmemory, integration, javascript, js, jugglingdb, ngrok, node, nodejs, nodemon, nosql, npm, oath, oauth2, redis, rest, slack, staging, webhook
Posted in Development, Javascript | No Comments »
Sunday, May 3rd, 2015
Nowadays in the realm of hybrid mobile application development there is a variety of available frameworks worth having a look at.
In the following tutorial I’d like to demonstrate the development life-cycle for a complete mobile application using Ionic, Cordova and AngularJS (and others) covering every step from the initial project setup, creating Angular Controllers, Directives, adding Cordova Plug-Ins, running and testing the application in the browser and emulator up to finally running the application on an Android device and assembling files for a release.
Finally I’d like to show some special features from the Ionic ecosystem like the Ionic Cloud and running our applications using the IonView app.
(more…)
Tags: ajax, Android, angular, angularjs, controller, cordova, cors, directive, emulator, gulp, hybrid, ionapp, ionic, ionview, ios, javascript, js, json, logcat, mobile, npm, sop
Posted in Android, Apps, Development | 7 Comments »
Tuesday, May 20th, 2014
There’s a variety of configuration frameworks to use in our Java applications. Java Config Builder is one of them and it offers some nice features that I would like to demonstrate in the following short examples as are:
Loading values from different sources like property-files, environment variables, command-line-arguments or system properties, specifying default values, mapping arbitrary types or collections, merging configurations and using the Java Bean Validation standard aka JSR-303.
(more…)
Tags: closure, config, config-builder, configuration, environment, java8, lambda, properties
Posted in Development, Java | No Comments »
Wednesday, May 7th, 2014
Recently in a project I encountered the following problem: The development team used Git with a branch-per-feature-like workflow and the integration server, Bamboo in this case, was configured not only to run the integration-tests for the master-branch but also for every change in a feature branch.
As the team developed a Java EE web application ports like 8080 occasionally were already bound and builds failed.
I knew a plug-in for Jenkins CI I to search for available ports and assign them to a build variable but I wanted to control such information directly within the Maven build life-cycle so I searched and finally found Sonatype’s Port Allocator Plug-in for Maven.
In the following short example I’m going to demonstrate how to allocate available random ports in a Maven build and assign them to an embedded servlet container.
(more…)
Tags: allocation, bamboo, ci, jenkins, jetty, maven, port
Posted in Development, Java, Web | 2 Comments »
Sunday, May 4th, 2014
Sometimes in a project there is the need to run tests for your client-side code, written in JavaScript from a Maven build.
One reason might be that Maven manages a complex build life-cycle in your project and you need a close integration for your JavaScript tests, another one might be that you’re in an environment where it is complicated to install and manage additional software like an integration- or build-server.
(more…)
Tags: bdd, devop, ghostdriver, headless, javascript, js, maven, phantomjs, tdd, testing, webdriver, yasmine
Posted in Development, Javascript, Web | 7 Comments »
Sunday, January 26th, 2014
Parboiled is a modern. lightweight and easy to use library to parse expression grammars in Java or Scala and in my humble opinion it is perfect for use cases where you need something between regular expressions and a complex parser generator like ANTLR.
In the following tutorial we’re going to create a simple grammar to specify a task list and write an implementation of a parser also as unit tests for each grammar rule in Java.
Additionally, we’re using the Scala variant of Parboiled to build up an Abstract Syntax Tree parser and analyze a given task list with it.
(more…)
Tags: ast, dsl, grammar, parboiled, parser, peg, sbt, scala
Posted in Development, Java, Scala | No Comments »
Sunday, September 15th, 2013
Having tried a bunch of workflow engines and business processing management platforms I now have given the Activiti framework a try.
I immediately liked the good test support using annotations and jUnit test rules, a straight API and the good Eclipse IDE integration as well as I liked the Activiti Explorer and the Activiti REST Application and the feeling to achieve quick results with less effort when using this framework.
In the following tutorial I’m going to an example BPMN process for an issue request process using different components like Groovy script tasks, service tasks written in Java, E-Mail service tasks and form builders.
Finally I’m showing how to write a full integration test for the process and how to run the process in a web application environment using the Activiti Explorer application.
(more…)
Tags: activiti, bpel, bpmn, business processing, drools, guvnor, jbpm, workflow
Posted in Development, Java | 9 Comments »
Tuesday, September 3rd, 2013
The Templating Maven Plugin looks useful if one needs to copy and to filter source files in a project e.g. to add property values from the build environment to a class.
For a short demonstration I’ve added the following short snippet.
(more…)
Tags: filtering, maven, plugin, source, templating
Posted in Development, Java | 1 Comment »
Wednesday, June 26th, 2013
Feature flags are a common technique, often combined with continuous deployment and delivery and they allow us to rollback a specific feature, to create A/B tests or to rollout a specific feature for a specific test group, a specific amount of users or dedicated systems.
In the following short examples I’d like you to demonstrate how easy it is to implement feature flags with the Togglz framework with a few steps in a Java EE environment.
(more…)
Tags: cdi, feature flag, java ee, java server faces, jsf, servlet, togglz
Posted in Development, Enterprise, Java | 1 Comment »
Wednesday, May 29th, 2013
Recently I needed a quick solution to deploy a Java EE 6 web application on a GlassFish instance automatically and subsequent to a successful build of the project on the integration server.
It took only a few steps using Jenkins, Maven and the Cargo plugin and I’d like to share this quick solution with you here.
(more…)
Tags: cargo, cd, continouous deployment, continuous delivery, continuous integration, git, glassfish, hudson, java ee, jee, jenkins, maven
Posted in Development, Enterprise, Java | 3 Comments »
Sunday, May 19th, 2013
Apache Pivot is a modern framework to create rich clients as desktop applications or to run in a web browser.
It offers nice GUI elements, supports XML/WTKX templates, data bindings, JVM scripting languages and much more.
In the following short examples I’m going to create a desktop application to open a file browser, select a file and output the selected file’s name, first using a programmatic approach to create the user interface, and afterwards using XML/WTKX templates.
(more…)
Tags: Apache, app, bxml, gui, pivot, rich client, wtkx
Posted in Development, Java | 2 Comments »
Monday, February 25th, 2013
The ability to attach lifecycle events to an entity using simple annotations sometimes is a neat feature in the Java Persistence API.
The following short snippets demonstrate how to bind and trigger the different available lifecycle events using an embedded derby database and a bunch of annotations.
(more…)
Tags: entitylistener, entitymanager, hibernate, java persistence api, jpa, orm, persistence
Posted in Development, Java, testing | No Comments »
Monday, July 16th, 2012
Functional programming is a trending topic these days and a lot of Java programmers are hot for the features that modern functional programming languages might offer.
Waiting for Java 8 and native closure support is a nice thing but for now we’re going to take a look at several Java frameworks that are trying to implement typical structures from those functional languages where possible using the capabilities of the Java language to emulate elements like higher-order-functions, closures, options and others …
(more…)
Tags: closure, commons-collections, funcito, functional, functional programming, functionaljava, guava, Java, lambda, lambdaj, maven, predicate, scala, transformer
Posted in Development, Java, Scala | 4 Comments »
Friday, May 18th, 2012
CoffeeScript is a neat language that is transcompiled into JavaScript but is more predictable and allows to write the same code with 1/3 fewer lines and of course with a (imho) nicer syntax.
CoffeeScript is nice but a vivid integration into our application build lifecycle with Maven is better and that is what the following example is all about.
(more…)
Tags: brew, coffeescript, compile, javascript, js, maven
Posted in Development, Web | No Comments »
Tuesday, March 6th, 2012
A lot has changed since Selenium RC and WebDriver has given us a new syntax to write tests for our web pages. PageObjects add an abstraction to the pages under test and finally we’re able to programatically start Selenium server instances and use them to run the tests.
In the following tutorial, we’re writing some tests using PageObjects, WebDriver, Selenium Server and finally we’re even taking some screenshots of our tested web pages..
(more…)
Tags: grid, junit, maven, pageobject, rc, regression test, selenium, tdd, testing, webdriver
Posted in Development, Java, testing | 1 Comment »
Monday, June 13th, 2011
I am currently working on a plugin that needs to receive some information from an LDAP/Active Directory using JNDI. That’s why I needed to set up a directory server in a short time and I didn’t want to waste much effort for here.
Luckily for me the Apache Directory Studio saved my day and allowed me to set up everything I needed in a few minutes.
Short and sweet: In this tutorial I’m going to show you how to configure everything you need in your Eclipse IDE and finally how to query the created LDAP server with a tiny java client using JNDI.
(more…)
Tags: active directory, ad, Apache, apacheds, eclipse, jndi, ldap, ldif
Posted in Development, Java | 3 Comments »
Tuesday, July 6th, 2010
Protocol Buffers are a serialization format developed by Google- you might ask if another IDL is really needed here – is Google barking at the wrong tree?
But protocol buffers offer some advantages over data serialization via XML or JSON – Google says they (compared to XML)..
- are 3 to 10 times smaller
- are 20 to 100 times faster
- provide generated data access classes for programmatic use
- provide backward compatibility
So lets play around a little with protocol buffers in Java and build a small application that serializes and deserializes some data using a defined format..
Tags: example, google, GWT, idl, Java, marshalling, maven, protocol buffers, serialization, tutorial
Posted in Development | 2 Comments »
Saturday, June 5th, 2010
In this short tutorial we are going to build a Java Server Faces Web-Application using JSF2.0, Facelets, Maven and Hibernate as ORM Mapper.
The goals for this first step are: Setting up the project structure using Maven, defining a frame template/decorator and a registration facelet, creating a managed bean and mapping it’s values to the facelet, adding some basic validation, displaying validation errors and finally adding a navigation structure.
In step2 of this tutorial we are going to add persistence using Hibernate, add some security, create a custom UI component and add some AJAX.
The Mojarra JSF implementation is used for this tutorial – perhaps I’m going to post more about the MyFaces implementation in another tutorial.
(more…)
Tags: eclipse, example, facelet, glassfish, hibernate, java server faces, jee, jsf, jsf 2, jsf2, maven, mojarra, mvc, servlet, tomcat, tutorial
Posted in Development, Java | 6 Comments »
Thursday, April 15th, 2010
Searching for nice coding kata sites I found this one – codingkata.org – I really liked because of the quick start and nice maven integration.
Just head over to the kata overview select the kata you wish to try out, copy the generated maven command line option and run it in the console – heres the code for the hello-world sample: (more…)
Tags: coding, kata, learning, maven, training
Posted in Development | No Comments »
Tuesday, April 6th, 2010
They built a nice new feature in Grails 1.2 called “named queries“. Named queries can be defined in a domain class as static properties and support the criteria builder syntax. (more…)
Tags: criteria builder, gorm, grails, groovy, hibernate, named queries, persistence
Posted in Development, Groovy/Grails | 2 Comments »
Sunday, April 4th, 2010
In a maven project there are lots of dependencies to handle – often one wants to know which version of a software comes from.
The solution to this problem is the Maven Dependency Plugin which helps you to find used/unused/declared/undeclared dependencies in your project.
In addition the plugin allows you to copy or unpack artifacts. (more…)
Tags: dependency, maven, plugin
Posted in Development, Java | No Comments »
Sunday, March 28th, 2010
In this tutorial we are going to build a SOAP client for the popular Confluence Wiki in about five minutes. The client is going to receive rendered HTML Markup from a specified Confluence Page.
(more…)
Tags: Axis, Axis2, Confluence, jax-ws, maven, rpc, soap, web service, wiki, ws, wsdl, wsimport
Posted in Confluence, Development, Java, Web Services | 11 Comments »
Friday, March 26th, 2010
This short tutorial shows how to set-up a developer instance of the popular Confluence Wiki from Atlassian in a few minutes.
It’s a prerequisite for a few following tutorials regarding the Confluence API and plug-in development for this system.
We want a quick install so we are going to run Confluence with the embedded servlet container and HSQL database.
(more…)
Tags: Atlassian, Confluence, development system, guide, quick install, tutorial, wiki
Posted in Confluence, Development | No Comments »
Thursday, March 18th, 2010
Sometimes there is a dependency not available at a remote repository and one is too lazy to set up a local maven repository – that’s when one adds a directory in the project structure and wants maven to find dependencies there.
(more…)
Tags: Build, deployment, Development, Java, maven, repository
Posted in Development, Java | No Comments »