BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. Scrum
  2. Apache Maven 2
  3. Essential MySQL
  4. Node.js
  5. Groovy
  1. jQuery Selectors
  2. Ajax
  3. Java
  4. Spring Config.
  5. Java Concurrency

Link Details

Link 99827 thumbnail
User 111696 avatar

By bloid
via usrportage.de
Published: Jul 31 2008 / 23:24

Constructors are often used to shortcut dependency injection and parameter passing on instantiation. This is a valid practice and often leads to shorter code. Consider the following example (a simple value object, often used to not mess around with floats and to keep currency and amount together)
  • 11
  • 1
  • 1491
  • 1

Comments

Add your comment
User 233461 avatar

antych replied ago:

0 votes Vote down Vote up Reply

This looks dumb, how about you document your code so the constructor's parameters are known? And you don't need setters for everything, some things just belong to the constructor.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.