Branching by Abstraction is a common approach now when trying to keep a software system functional though all the changes. Imagine, you would like to change your persistence framework, from iBatis to Hibernate to JPA back to something different. One approach is, just doing it. This will break your application immediately and you will need hours/days/weeks until it runs again. No matter whether you’re on a branch or within the development head (trunk/master). A no-go, especially when you’re into Continuous Delivery.
mp911de
-
Exceptions are an aspect of modern software
Java is currently the one and only language having checked exceptions. More and more frameworks switch to unchecked exceptions over time, moving them out of focus, making them invisible. Therefore exceptions become an aspect of modern software and should be treaded in an adequate way: Don’t let your code be exception driven.
-
Clean your Architecture: Databases, the Web and Service-Interfaces are just plugins
For quite a long time I was seeking for a reasonable explanation of software architecture. Nobody could provide a sufficient description. Developers and software architects would describe their architecture perhaps this way: We use Model-View-Controller for the Web, EJB as Controller, havin Hibernate as persistence framework.
Layering, multi-tier, Hibernate, Java Server-Faces aren’t an architecture. They are ideas for code organization, tools or somewhat, but for sure not an architecture.
-
Automating Integration tests
Integration Testing describes every test, which integrates more than one component that is tested.
Lots of developers are writing test using JUnit, PHPUnit, NUnit and so on. These tests invoke some piece of code, that do something. This „something“ can be a in-memory calculation, access to databases or even accessing remote services. Unit tests are tests which test a single unit, a method, a class. As soon as this method or class tries to access something, which is outside of your working memory, it’s most likely an integration test. Integration tests are very valuable, but in most cases you perform integration testing without knowing it. In most cases you’ll notice it, as soon as you run your tests without network or somebody kills the database. And then you might be screwed. This example gives some impression what the difficulties are: External systems, services you can’t contol (yet), shared databases. Because of these and sometimes because the benefit is not seen integration tests are not automated.
-
Amazing experiences with Puppet
Do you know Puppet? Puppet is a system management/provisioning tooling. It’s intended to specify a set of resources (files, software packages and many more) to be in a certain state. This is very hand for all the cases, where you need for example Apache and PHP, you want to apply an own php.ini, have a customized logrotate.conf, some cron jobs… All this can be specified using Puppet. The first time your system boots, all the specifications are applied and you don’t have to copy config files anymore. Puppet runs also every 30mins (by default) to check for new/changed rules.
-
Fun with RESTEasy and Jersey: Replace your Servlets!
Some time ago I got in touch with one of my 2006 written applications. I got flashed at the moment I looked into my code.
My intention was to perform some improvements. 2006 had very few frameworks to deal with HTTP interfaces. The most common interface types were GUIs (JSP/JSF) and some SOAP Services. Writing HTTP interfaces for API use (calls from JavaScripts and so on) was still a hard way in Java applications. In most cases servlets were used. Those servlets received either Query- or Form-Params to perform the processing. Sometimes they even accepted/produced some XML. Let me show you some examples and how to solve them using current technology.
-
Testing SOAP WebServices using Axis2, JUnit and Mockito
Prior to this article I wrote about testing SOAP WebServices locally. This was accomplished using JAX-WS. Lots of projects still use Axis or Axis2. Therefore I created a simple Axis2 setup to demonstrate JUnit-Testing of WebServices.
(more…) -
Continuous Delivery: Providing multiple configuration versions in parallel
In Continuous Delivery you deliver often and to different environments. When it comes to configuration files you have to maintain multiple instances at a time. You can’t just have one fits it all. The Configuration Server is built to support you in this scenario. Basic idea of the Configuration Server is: Serve configuration based on your host for multiple artifacts and versions.
-
Continuous Delivery: Inject configuration properties into EAR/WAR-Artifacts to keep them portable
As soon as you start Continuous Delivery you don’t want to build artifacts for a specific environment. Once you’ve built and packaged, you want to reuse it in Dev, UAT, Production and so on.
(more…) -
Continuous Delivery: Securing sensitive configuration data and passwords using a Configuration Server
I’d guess, nearly every developer, who assisted on releasing and go-live of his software ran into the same issue: How to deal with sensitive configuration data such as passwords, keys and tokens? Hard-coding of passwords it out since the late ’90s. Writing passwords in plain-text into config-files is as well a security breach. Encrypted passwords within config files are much better but demand you to implement some kind of encryption. Still you have then the problem: Where to put the encryption key?