Click here to Skip to main content
15,920,896 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
QuestionUser Defined Lookups Pin
Kevin Marois26-Jun-18 8:05
professionalKevin Marois26-Jun-18 8:05 
AnswerRe: User Defined Lookups Pin
Mycroft Holmes26-Jun-18 14:51
professionalMycroft Holmes26-Jun-18 14:51 
AnswerRe: User Defined Lookups Pin
Gerry Schmitz27-Jun-18 10:02
mveGerry Schmitz27-Jun-18 10:02 
GeneralRe: User Defined Lookups Pin
Kevin Marois27-Jun-18 10:05
professionalKevin Marois27-Jun-18 10:05 
GeneralRe: User Defined Lookups Pin
Gerry Schmitz27-Jun-18 10:28
mveGerry Schmitz27-Jun-18 10:28 
GeneralRe: User Defined Lookups Pin
Kevin Marois27-Jun-18 10:30
professionalKevin Marois27-Jun-18 10:30 
PraiseIdentifying Vulnerable Source Code Pin
David A. Gray5-Jun-18 11:28
David A. Gray5-Jun-18 11:28 
GeneralData Mapper Pattern Using Events Pin
Paramecium135-Jun-18 7:03
professionalParamecium135-Jun-18 7:03 
The Data Mapper pattern is an effective way to decouple the domain model from whatever data storage system the application uses. However, one thing I noticed about it is that it does not explain how and when the data mapper should be notified that it needs to update the data.

I propose that the domain object notifies the data mapper (and, possibly any other objects that are interested) when one of its fields/properties changes via an event (I use C#, which supports events and properties and have the code to publish the event in the property's getter). The data mapper can then do whatever it sees fit to do with this information. Using events also inverts the dependency between the domain object and its data mapper.

Whenever a domain object is created in memory (either read from data or completely new), a data mapper should subscribe to its relevant events. There could be one data mapper per domain object or one per type of domain object. Additionally, the logic for creating, reading, and deleting domain objects need not be in the same data mapper that handles updates.

GeneralRe: Data Mapper Pattern Using Events Pin
Nathan Minier6-Jun-18 1:40
professionalNathan Minier6-Jun-18 1:40 
GeneralRe: Data Mapper Pattern Using Events Pin
Paramecium137-Jun-18 6:41
professionalParamecium137-Jun-18 6:41 
GeneralRe: Data Mapper Pattern Using Events Pin
Nathan Minier7-Jun-18 6:49
professionalNathan Minier7-Jun-18 6:49 
GeneralRe: Data Mapper Pattern Using Events Pin
Paramecium137-Jun-18 7:12
professionalParamecium137-Jun-18 7:12 
GeneralRe: Data Mapper Pattern Using Events Pin
Nathan Minier7-Jun-18 7:30
professionalNathan Minier7-Jun-18 7:30 
SuggestionRe: Data Mapper Pattern Using Events Pin
Eddy Vluggen6-Jun-18 1:50
professionalEddy Vluggen6-Jun-18 1:50 
GeneralRe: Data Mapper Pattern Using Events Pin
Paramecium136-Jun-18 8:16
professionalParamecium136-Jun-18 8:16 
QuestionUnified Naming Conventions Pin
David A. Gray29-May-18 8:53
David A. Gray29-May-18 8:53 
AnswerRe: Unified Naming Conventions Pin
Eddy Vluggen31-May-18 0:17
professionalEddy Vluggen31-May-18 0:17 
GeneralRe: Unified Naming Conventions Pin
David A. Gray31-May-18 14:14
David A. Gray31-May-18 14:14 
GeneralRe: Unified Naming Conventions Pin
Eddy Vluggen1-Jun-18 0:04
professionalEddy Vluggen1-Jun-18 0:04 
GeneralRe: Unified Naming Conventions Pin
David A. Gray1-Jun-18 11:28
David A. Gray1-Jun-18 11:28 
GeneralRe: Unified Naming Conventions Pin
Eddy Vluggen2-Jun-18 1:19
professionalEddy Vluggen2-Jun-18 1:19 
GeneralRe: Unified Naming Conventions Pin
David A. Gray2-Jun-18 6:48
David A. Gray2-Jun-18 6:48 
GeneralRe: Unified Naming Conventions Pin
Eddy Vluggen3-Jun-18 0:39
professionalEddy Vluggen3-Jun-18 0:39 
GeneralRe: Unified Naming Conventions Pin
David A. Gray3-Jun-18 13:08
David A. Gray3-Jun-18 13:08 
AnswerRe: Unified Naming Conventions Pin
Gerry Schmitz1-Jun-18 7:56
mveGerry Schmitz1-Jun-18 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.