BasePatterns.org

"A good designer must rely on experience, on precise, logic thinking; and on pedantic exactness. No magic will do." - Niklaus Wirth

Pulse

On Management

IT pros are [..] prone to express their opinions [..] proportional to the absurdity of the event. [..] Presuming this is a trait that must be disciplined out of them is a huge management mistake.

-
Jeff Ello

On Maven

“Maven is the ugliest, wierdest, most confusing, most under documented, most XML heavy, most frustrating build system out there and is still better than the alternatives.”

Howard Lewis Ship

On Linux

“..of course Canonical is only a small part of the overall Ubuntu community now.”

Mark Shuttleworth

On Separation of Concerns

“In enterprise architecture, the most important separation is between business logic and infrastructure.”

- Malcolm Sparks

On The Evolution of the UI

“Ultimately, people care about productivity, not technology. Something needs to incent them, to move away from their browser. The browser created the web. RIAs will create the next generation of the internet. Now people just need to write them.”

- John

On OSGi as an alternative to JEE

“Right now JEE is kind of like a big box of rocks—you get everything inside whether you need it or not..”

- Eric Newcomer

February 17th 2012
Tags: Build

No Comments

Bootstrapping an OSGi environment

Something I have always lamented about OSGi is a lack of simple examples to get up and running quickly. So here is a simple example using Groovy: First, dependencies are easily added via Maven, adding the following to your pom.xml should do it. [code] <dependencies> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.framework</artifactId> <version>4.0.2</version> </dependency> </dependencies> [/code] Then a simple Groovy script to start ...
October 18th 2011
Tags: Uncategorized

No Comments

Prevent multiple instances of an application

A simple way to prevent running of multiple instances of your application is to use Socket communication. For example, in Groovy the first thing you would execute is something like this: [code] try { // choose a unique port (!!) new Socket('localhost', 1337) ...
November 2nd 2009
Tags: Java

No Comments

Service Selector

Sometimes we may have more than one implementation and/or instance of a service to which we need to route requests. Routing may be controlled by a number of different factors, such as the request type, request arguments, runtime configuration, etc. An implementation of such routing might look something like this: [java] public interface ...
October 13th 2009
Tags: Java

No Comments

Uniform Caching

Typically object caching in Java is managed by the container or framework in use. Occasionally however there is a need to manually cache domain-specific objects, whereby a java.util.Map implementation will not suffice. Using the popular ehcache framework as an example, the following pattern is typically observed: [java] public class SomeClass { private ...
October 8th 2009
Tags: Java

No Comments

Whiteboard Registry

In OSGi using a publisher/subscriber design can be somewhat more complicated that traditional Java environments: [java] public class SomeBundleActivator implements BundleActivator { private SomeService service = ... private ServiceRegistration registration; public void start(BundleContext context) { registration = context.registerService(SomeService.class.getName(), service, null); } ... } public class AnotherBundleActivator ...