Mappers
A Mapper is the primary means of mapping object-oriented programming objects to data sources managed by relational databases or other sources of data. A Mapper provides 2-way (Read and Write) access to the underlying Data Source.
The Mapper is used to map data from one or more tables, possibly via a view or stored procedure, to application memory, to the User Interface (UI), and back again. The Mapper manages all Create/Read/Update/Delete activity against the database as configured in meta-data and provides events for overriding its standard behavior.
Mappers implement the IMapper interface which allows programmatic manipulation of the data during any stage of the page life-cycle. Mappers can also be used in a purely programmatic role, with no UI, to manage your database.
By attaching code extensions to Mappers you can implement business logic for your application on a single object, multiple objects, or globally.
Many of the capabilities of the mapper are configurable with meta-data and requiring no custom code:
Functionality | Granularity | |
Logical delete | Row | |
Optimistic locking | Row | Uses row-revisioning. |
DB Transaction | Row | With rollback on errors. |
View write-through | Row | |
Permissioning | Row/Col | |
Required Fields | Col | Client-side validation with server-side redundancy. |
Data validation | Col | Client-side validation with server-side redundancy. |
Duplicate checking | Row | |
Default values | Col | |
Identity columns | Col | |
Versioning | Row/Col | |
Localization | Row/Col | And internationalization. |
Datatype mapping | Row/Col | DB to/from .NET datatypes. |
Timezone handling | Col | Including support for user-local timezone conversion. |