Skip to content

Tag Archives: patterns

‘Disappeared’ DAO layers

Adam Bien still wants to believe that a JPA layer can directly replace a formal ‘DAO layer’. And I still disagree. I might agree that for simple enough systems, it could end up being that in fact the service layers end up with PersistenceManager logic directly in their methods. But then I might say a [...]

Does JPA kill the DAO Pattern?

Oliver Gierke definitely thinks not. And I concur with him. A couple of years ago I got into an running battle with a developer at my old workplace as to whether the JPA architecture abstracted away enough of the persistence to justify eliminating the database layer. My answer was, and still is, certainly not! The [...]

In which magic method naming is considered to be harmful

AKA EJB <= 2.x Entities are a stupid idea stupidly implemented. A blast from the past. What idiot decided this was a good idea? public interface SomeEntity { String getType(); String getName(); }   public interface SomeEntityHome extends EntityHome { SomeEntity findBySomeData(String name, String type); }   public class SomeEntityEjb implements SomeEntity, EntityBean { public SomeEntity [...]

log.debug()

So everybody knows printing debugging statements to the log file can take considerable amounts of time, right? And in order to decrease useless time logging debug statements that won’t appear in the log, you can use isDebugEnabled() to find out if you’re wasting your time, right? So you end up with; if (log.isDebugEnabled()) {    [...]

Dependency Injection: “Don’t look for things!”

Here’s a piece of advice I definitely can take to heart. From Google testing blog: *Clean Code Talk Series* *Topic: Don’t Look For Things!* http://googletesting.blogspot.com/2008/11/clean-code-talks-dependency-injection.html Recently I’ve been doing maintenance work on a system that has a lot of custom-rolled code to do stuff like, look up EJB Home and Remote references. Even though parts [...]