Using Spring/AOP to inject in ‘new’ objects with @Configurable

I am currently working on Web project using Hibernate/Spring for the persistence layer. I decided to use the not the old DTO/DAO. That means the data is encapsulated in POJO’s, the Data Transfer Objects (DTO’s), and Data Access Objects (DAO’s) are used to actually access the database. Typical methods from DAO’s are getXXXById, create, … Ok, so far so good. The next thing I wanted to do, is to use the DAO’s in other objects, let’s call them Commands. Such a command gets some information, makes some checks, and does something. Some of them are checking if an entity already exisits, e.g. if an entity with the same username already exists. Not really a problem until now, but I also want to test the commands, therfore, I need some mocks. In this case I need DAO mocks. So the DAO’s have to be interchangeable while the Commands are created with “new”. Further, I wanted them injected before the constructor runs.

Continue Reading »

heli's blog heli 23 Apr 2008 No Comments

JAX 2008, the first day

As I already wrote, I am at the JAX in Wiesbaden this week. It is my first big Java conference and I am kinda excited.

My colleagues and I arrived in time and the day started right away with the Welcome-Speech from Sebastian Meyen. He told us about the how JAX started, the sessions today, trends, and the evening program (poker!). However, I waited for the keynote from Rod Johnson. Rod is the creator of the Spring Framework and currently involved in the JCP 316, JEE 6. He made no secret about how he feels for the JEE 5 stack and about the situation right now: EJB will be dead and JEE’s last hope is JEE 6 (all about what the user/programmer wants and simplicity). JEE 6 is formed around two slogans: Extensibility and Profiles. Extensibility means that it must be simpler to integrate frameworks in JEE and don’t be stucked to the shipped ones. This should help to get companies/developer involved and so create more competition in the JEE environment. Today it is all about IBM and Oracle/BEA in the JEE server market. Profiles help to get only what you want. Normally the full JEE stack is huge, but only a subset is needed. For JEE 6 three profiles are planned like light, medium, and all-you-can-eat.

Continue Reading »

heli's blog heli 23 Apr 2008 1 Comment

Worst April 1st Jokes

On April 1st everyone thinks he/she is funny (including myself). That’s why I got three shocks today:

  1. Netbeans 7.0 plans uncovered
  2. KDE supports Office Open XML
  3. Spring Source bought by Microsoft

heart attack

Especially the Netbeans joke got me because I read it in the morning and was still sleepy. However, my heart is recovering and maybe the jokes are a little bit funny.

heli's blog heli 01 Apr 2008 No Comments

« Previous Page