Some thoughts about application configuration (in German):
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.
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:
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
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…
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