Wrap IDs in objects

By Adrian Smith5 Dec 2013300 words2 mins to read

In Java, I like to wrap ID values in objects, rather than just passing them around the code as their native "int" or "long" or "String" values.

The reasons are twofold why using an object is better:

Things to consider when writing such an "ID object"

This article was written by Adrian Smith on 5 Dec 2013

Follow me: Facebook | Twitter | Email

More on: Java | Coding | Software Architecture