{"action":"opened","issue":{"url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/72","labels_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/72/comments","events_url":"https://api.github.com/repos/MarimerLLC/cslaforum/issues/72/events","html_url":"https://github.com/MarimerLLC/cslaforum/issues/72","id":111870436,"number":72,"title":"Using CSLA for a synchronization system","user":{"login":"pwil301","id":5342812,"avatar_url":"https://avatars.githubusercontent.com/u/5342812?v=3","gravatar_id":"","url":"https://api.github.com/users/pwil301","html_url":"https://github.com/pwil301","followers_url":"https://api.github.com/users/pwil301/followers","following_url":"https://api.github.com/users/pwil301/following{/other_user}","gists_url":"https://api.github.com/users/pwil301/gists{/gist_id}","starred_url":"https://api.github.com/users/pwil301/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwil301/subscriptions","organizations_url":"https://api.github.com/users/pwil301/orgs","repos_url":"https://api.github.com/users/pwil301/repos","events_url":"https://api.github.com/users/pwil301/events{/privacy}","received_events_url":"https://api.github.com/users/pwil301/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-16T16:58:13Z","updated_at":"2015-10-16T16:58:13Z","closed_at":null,"body":"G'day. Need some best practice guidance for CSLA objects that read and write from/to multiple stores. We're working a system that synchronizes a large volume of records between two different endpoints. The data is streamed from the source into a local cache, validated and altered as required by rules, and then streamed back out to a sink. For each record in the source, the destination is first queried for a match. If found, the match is updated in the destination. If not, it is created. Deletes are handled separately.\r\n\r\nThis results in having an object that fetches from the source, but also must fetch from the destination before ultimately writing to the destination. I'm looking for design best practices regarding how to use two different connection configurations within the same object.\r\n\r\nFor example, a given object needs to have configuration data to tell it to read from one repository or another. What's the best way to inject that logic? Should I have the Person object in another assembly and a controller object that passes it the appropriate connection information it will need? I feel the business rules are going to get hazy as some rules only apply for a given connection. Should I create two different objects and handle then generate instances of the destination object in the processing code of the source object? I just need pointed in the right direction."}}