News for hackers. Stuff that matters.
Re:Things Java Programmers can learn from Clojure by mercurial on Thursday March 07, 2013 @04:28AM (#5336861)
> 2. Do no work in the constructor

> Are constructors still used? All services are wired using dependency injection. Models are either DTOs or Hibernate POJOs - both dumb and anyways don't do any work.

Guice encourages constructor injection.

> 3. Program to small interfaces:

> Interfaces are dictated by functionality they provide and not size. They can have hundreds of methods. This is how it looks: DocumentService - put every document related method in here, FinancialInstrumentService - put every instrument related method in here

Surely, by the point you reach hundreds of methods, you can refactor your service into several different, smaller services.

There are no comments on this comment yet.