{"action":"closed","issue":{"url":"https://api.github.com/repos/financialforcedev/fflib-apex-common/issues/104","repository_url":"https://api.github.com/repos/financialforcedev/fflib-apex-common","labels_url":"https://api.github.com/repos/financialforcedev/fflib-apex-common/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/financialforcedev/fflib-apex-common/issues/104/comments","events_url":"https://api.github.com/repos/financialforcedev/fflib-apex-common/issues/104/events","html_url":"https://github.com/financialforcedev/fflib-apex-common/issues/104","id":132375714,"number":104,"title":"Domain Event Pattern - can and should it be done?","user":{"login":"up2go-rsoesemann","id":8180281,"avatar_url":"https://avatars.githubusercontent.com/u/8180281?v=3","gravatar_id":"","url":"https://api.github.com/users/up2go-rsoesemann","html_url":"https://github.com/up2go-rsoesemann","followers_url":"https://api.github.com/users/up2go-rsoesemann/followers","following_url":"https://api.github.com/users/up2go-rsoesemann/following{/other_user}","gists_url":"https://api.github.com/users/up2go-rsoesemann/gists{/gist_id}","starred_url":"https://api.github.com/users/up2go-rsoesemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/up2go-rsoesemann/subscriptions","organizations_url":"https://api.github.com/users/up2go-rsoesemann/orgs","repos_url":"https://api.github.com/users/up2go-rsoesemann/repos","events_url":"https://api.github.com/users/up2go-rsoesemann/events{/privacy}","received_events_url":"https://api.github.com/users/up2go-rsoesemann/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/financialforcedev/fflib-apex-common/labels/discussion","name":"discussion","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-02-09T09:57:52Z","updated_at":"2016-06-12T09:22:52Z","closed_at":"2016-06-12T09:22:52Z","body":"In [Domain Driven Design][1] a [single pattern is drawing a lot of attention][2] to itself - Domain Events and Event Queues.\r\n\r\n[![enter image description here][3]][3]\r\n(slide via http://de.slideshare.net/andysal/never-mind-the-bollocks-heres-the-domain-driven-design)\r\n\r\nDomain Events models non-technical events as their own entity and allow code that needs to react to those event to subscribe to such events. A kind of Pub/Sub, Observer pattern to decouple code.\r\n\r\nI'm a strong believer in applying Enterprise Pattern to the Apex space especially if they are adapted to the special characteristics of the Force.com platform. I see a great use case in using libraries like the awesome [FinancialForce Apex Common][4].\r\n\r\nSo my questions to the expert out there are:\r\n\r\n 1. Does it make sense to port something like this to the Salesforce.com world?\r\n 2. Have you done it and with which experience?\r\n 3. How would one implement the Event queue? Using Async Queuable jobs? Streaming API?\r\n\r\n\r\n  [1]: https://en.wikipedia.org/wiki/Domain-driven_design\r\n  [2]: http://de.slideshare.net/heinodk/domain-event-the-hidden-gem-of-ddd\r\n  [3]: http://i.stack.imgur.com/8HtQ5.jpg\r\n  [4]: https://github.com/financialforcedev/fflib-apex-common"}}
{"actor":{"display_login":"afawcett"}}