Reputation: 380
In context of PHP MVC frameworks, what is the role of Data Mappers and Data Managers. How do they differ or what are their common responsibilities.
Based on what I have read from different sources, mappers transform a DTO to an object representing database entity and managers transform a DTO to a business entity. So will I have separate classes for representing plain data as DTO, its DB version and its business version and then separate classes for conversions.
Upvotes: 0
Views: 116
Reputation: 58444
What you have read are probably a compilation of buzzwords. Not sure which are the "mvc frameworks" you are talking about, but Data Mapper is a pattern for exchanging data between persistent storage and an object. It does not matter, what specific responsibilities that object realizes, since the object is not aware of being mapped.
As for "Data Manager" - it is meaningless. People tend to attach the "manager" part to classnames, when they don't know, what else to call it.
Upvotes: 1