javaconfig method injection spring

Spring method injection with Java Configuration

Last week, I described how a Rich Model Object could be used with Spring using Spring’s method injection from an architectural point of view. What is missing, however, is how to use method injection with my new preferred method for configuration, Java Config. My start point is the following, using both autowiring (shudder) and method injection. public abstract class TopCaller { @Autowired private StuffService stuffService; public SomeBean newSomeBean() { return ne

method injection rich domain object spring

Rich Domain Objects and Spring Dependency Injection are compatible

I’m currently working in a an environment where most developers are Object-Oriented fanatics. Given that we develop in Java, I think that it is a good thing - save the fanatics part. In particular, I’ve run across a deeply-entrenched meme that states that modeling Rich Domain Objects and using Spring dependency injection at the same time is not possible. Not only is this completely false, it reveals a lack of knowledge of Spring features, one I’ll be trying to correct in this ar

hack

getCaller() hack

As developers, we should only call public APIs. However, the Java language cannot differentiate between public API and private stuff: as soon as a class and one of its method is public, we can reference the former and call the later. Therefore, we are exposed to the Dark Side of the Force, and sometimes tempted to use it. A good example of this terrible temptation is the sun.reflect.Reflection.getCaller(int) method. As its name implies, this evil piece returns which class called your current co

hibernate jooq persistence

No more Hibernate? Really?

I recently stumbled upon this punchy one-liner: No More Hibernate!. At first, I couldn’t believe what I read. Then, scrolling down, I noticed that the site was linked to jOOQ, a framework that advocates for SQL to have a first-class status in Java: SQL was never meant to be abstracted. To be confined in the narrow boundaries of heavy mappers, hiding the beauty and simplicity of relational data. SQL was never meant to be object-oriented. SQL was never meant to be anything other than

Java scala verbosity

On the merits of verbosity and the flaws of expressiveness

Java is too verbose! Who didn’t stumble on such a rant on the Internet previously? And the guy bragging about [Insert expressive language there], that which soon replace Java because it is much more concise: it can replace those 10 lines of Java code with a one-liner. Ah, the power! Unfortunately, in order to correlate conciseness with power (and verbosity with lack of power), those people take many shortcuts that once put into perspective make no sense at all. This article aims to surgic

duchess swiss soft-shake

Happy summer holidays

The time of the year has come for me to go on holidays. For two weeks, no technology watching, no tech post reading, no blogging, no coding and most important of all, no computer at all. If you belong to the group of people who already spent their holidays - or even worse, to those who do not have vacations, rejoice (or not)! Not only will I think about you, but when I go back, I’ll bring with me more Vaadin sweetness: On September 11th, I’ll be leading a Vaadin 7 workshop under th

The Leprechauns of Software Engineering

This review is about The Leprechauns of Software Engineering by Laurent Bossavit, self-published Leanpub. Facts 13 chapters, $5 minimum, $10 suggestedThe book is about many things we all take for granted in software engineering, and that have no reliable underlying scientific basis Pros and cons This is not your average tech book, nor your average methodology book. As such, it cannot be reviewed through the pros/cons prism. Wrap-up Software is thought of as an engineering science: a

ant build gradle maven

Stop the f... about Gradle

Stop the f… about #Spring & #Hibernate migrating to #Gradle. Repeat after me: "my project do NOT have the same requirements" #Maven— Nicolas Frankel 🇺🇦🇬🇪 (@nicolas_frankel) July 16, 2013 This was my week’s hate, and I take full responsibility for every character in it. While that may seem like a troll, Twitter is not really the place to have a good-natured debate with factual arguments, so here is the follow up. Before going into full-blown rhetoric mode, let me