A Rich Internet Application (RIA) Pattern
The scenario considers a RIA accessing a database without transferring any sensitive data by using a 3-tier design:
The proposed solution is:
The solution makes use of the following patterns:
- User interface processing is handled by a Model-View-Controller pattern.
- The user interface is composed of multiple controls, with some that can be bound to data elements.
- A proxy is used to communicate between the presentation layer and service layer
- The Data Transfer Object (DTO) pattern is used to package multiple data structures into one.
- The service layer provides translation between internal and external data structures.
- The business layer uses a façade pattern to support coarse-grained message-based operations.
- Transaction Script objects are used to handle business request processing.
- A Repository pattern is used to access domain entities.
- A Domain Entity pattern is used to define business entities that contain data only.
- A Data Mapper pattern is used to map domain entities to the database schema.
The guide explains in detail each pattern used and offers a technical solution which is, of course, based on Microsoft’s products. The respective solution can be nonetheless used with different products including open source ones.
Every time someone misuses the DTO pattern or misidentifies it, a clown dies. You don't need a DTO to "send" objects, only to "receive" them only then if your plaform can only have one return type.
It seems they separate the "business" and "service" layer. Not sure what this gains you or even why.
Domain entities are only data? That is what DTOs are. When I retrieve objects in a list, I sometimes use a "SearchResult" or "ReportObject" but these are created at the "Data Mapper" level.
Randy Shoup Jul 03, 2015