Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: