31 März 2014

Toughts about Application Configuration

Some thoughts about application configuration (in German):

http://www.simas.ch/2014/03/applikationskonfiguration-in.html

Migrating from GlassFish to ?

There is an interesting report form Markus Eisele, Simon Maple, Hildeberto
Mendonca, Oleg Shelajev and Oliver White available on RebelLabs about Migrating from GlassFish to JBoss or TomEE.

Check it out: http://zeroturnaround.com/rebellabs/abandon-fish-migrating-from-glassfish-to-jboss-or-tomee/#!/

10 März 2014

Use JNDI to Configure your Java EE App

There are a lot of people talking about Java EE configuration these days. But often they forget about JNDI (Java Naming and Directory Interface).

Configuration using JNDI has the advantage that you can use dependency injection. i.e.

@Resource(mappedName = "java:global/mystring")
private String mystring;

The configuration for example in JBosss EAP or Wildfly is pretty simple made in the standalone.xml (or domain.xml) file:

<subsystem xmlns="urn:jboss:domain:naming:1.4">
  <bindings>
    <simple name="java:global/mystring" 
            value="My String" 
            type="java.lang.String"/>
     </bindings>
     <remote-naming/>
</subsystem>

As you can see the type can be defined. If you need more complex objects simply use ObjectFactory http://docs.oracle.com/javase/7/docs/api/javax/naming/spi/ObjectFactory.html

Read more about JNDI in WildFly: https://docs.jboss.org/author/display/WFLY8/JNDI+Reference
and more about ObjectFactory: http://middlewaremagic.com/jboss/?p=1690

05 März 2014

When to Use a Library (or Framework)

Lukas Eder just posted a note about when to use a framework: http://blog.jooq.org/2014/03/05/when-to-use-a-framework/

I totally agree! And I think it is not only limited to big frameworks like JPA/Hibernate.
Often developers spend a lot of time evaluating a library that solves their problems. But sometimes it would be easier to write a few lines of code to solve the problem.

If you do it your self there are two advantages 1) you better understand the problem because you solved it on your own and 2) your solution is exactly what you need. There are no dependencies to a big framework or library that may have their own dependencies etc.

For sure my idea does not scale. If your problem is O/R-mapping it doesn't make sense to create your own Hibernate. But if you just need some small utilities - why not think about...

04 März 2014

Java EE Configuration

Currently I am working for a IT department as a middleware engineer. Defining processes and setup JBoss EAP.

Application configuration is a very important thing and I found an interesting post from Nicolas de Loof.
Check it out: http://blog.loof.fr/2013/10/configuration-management-jsr.html