jargon

Comparison

Row data gatewayvsTable data gateway

Row data gateway

each object is exactly one row, with a getter per column and nothing that knows anything about the business.

An object that represents a single record, holding its fields and the methods to load and save it, with no domain logic. It is active record minus the behaviour, and it exists as a name mostly to make that comparison possible. Its usefulness today is in explaining what an ORM-generated entity actually is when nobody has added methods to it.

Full entry →

Table data gateway

one object holds every query for one table, and it returns rows rather than domain objects.

A single object acting as the gateway to one database table, with a method per query and no domain behaviour. It keeps SQL out of business logic without pretending to map anything to a model. It is the simplest useful persistence pattern and the direct ancestor of what most teams call a DAO.

Full entry →

Related comparisons