d omain and persistence patterns l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
D omain and Persistence Patterns PowerPoint Presentation
Download Presentation
D omain and Persistence Patterns

Loading in 2 Seconds...

play fullscreen
1 / 13

D omain and Persistence Patterns - PowerPoint PPT Presentation


  • 199 Views
  • Uploaded on

D omain and Persistence Patterns. Fundamental Pattern Types. Design Patterns Business Logic Patterns. Business Logic Patterns. Transaction Script Domain Model Table Module. Transaction Script. User Action relates directly to database action Typically CRUD operations

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'D omain and Persistence Patterns' - elmo


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
fundamental pattern types
Fundamental Pattern Types

Design Patterns

Business Logic Patterns

business logic patterns
Business Logic Patterns

Transaction Script

Domain Model

Table Module

transaction script
Transaction Script

User Action relates directly to database action

Typically CRUD operations

Database code is straight-forward

Result can be displayed to user

using objects
Using Objects

Complex business logic can require multiple processing paths, with multiple options

Better modeled with classes in domain layer

table module
Table Module

Class corresponds to virtual database table

Use record or data set

Still CRUD operations

Good for applications with minimal business logic complexity, but complicated data relationships.

table module issues
Table Module Issues

Applications do not always have a simple relationship with database tables

Close coupling of database and business logic

Can make evolving the application difficult

domain model
Domain Model

Model business logic with classes

Use interface based polymorphism to partition and layer

Object-relational mismatch

why use domain model
Why use Domain Model?

Many applications do not stay simple

Simple apps will have minimal object-relational mismatches

Hard to evolve Transaction Script or Table Module.

Domain Modeling:

Eric Evans, "Domain Driven Design"

Jimmy Nilsson, "Applying Domain-Driven Design and Patterns

isolating database logic
Isolating Database Logic

Separate Business Logic from Storage Code

Persistence Patterns

Data Mapper

Repository

data mapper pattern
Data Mapper Pattern

Maps Domain Objects to Database Tables

Object Relational Mapping (ORM)

Simple Implementation in current example

ICustomerDataMapper

Interface based design

Inversion of Control

repository pattern
Repository Pattern

Query based on objects, not relational tables

Simple criterion query

Returns a collection of objects

Uses Data Mapping layer

Interface based Inversion of Control

summary
Summary

Domain patterns are industry specific

Persistence patterns separate the business logic from knowledge of how the data is stored

Interface based design

Data Mapper Pattern

Repository Pattern