What is the difference between POJO (Plain Old Java Object) and DTO (Data Transfer Object)?

d1ck50n picture d1ck50n · Sep 15, 2009 · Viewed 26.5k times · Source

I cannot find difference between them. Does anyone know how to differentiate them?

Answer

SingleShot picture SingleShot · Sep 15, 2009

POJO or "Plain Old Java Object" is a name used to describe "ordinary" Java objects, as opposed to EJBs (originally) or anything considered "heavy" with dependencies on other technologies.

DTO or "Data Transfer Object" is an object for... well... transferring data, usually between your "business" classes and persistence layer. It typically is a behavior-less class much like a C-style struct. They are an outdated concept.