by oblique63 · 12y ago · 0 comments
This post in particular seems to be advocating the concept of having a single 'aggregate root' as opposed to independently loaded 'entities', and Flux sounds like it just advocates the use of an 'event bus' to send separate 'read'/'write' 'commands' to 'domain objects'... the main difference of course being that all this recently has been specifically with the browser in mind. Is that a reasonable assessment?
Amongst people that I associate with that build complex web apps, there's been an ongoing debate on whether a centralized event dispatch (what Flux advocates) is preferable to decentralized event emitting components (what Backbone and web components advocate).
For most of my career, I've been a fan of decentralized event emitting components. However, with Om's persistent data structures and functional render loop, having all of your data in a single place is suddenly a lot more palatable. From there, I think the event bus approach flows naturally.
Or at least, that's what I'm thinking now :) I still haven't written something with complex enough tests and other external dependencies to have gotten bit by this yet.
I even suspect if Peter Hunt mentioned how they are doing DDD+CQRS for building applications, it might have been met with ridicule from audience.
It is kind of interesting, the field of software engineering is not that old, but there already probably multiple cycles of the same concept being rediscovered over and over again.
Another rather cliche one is callback based concurrency. There was a wave of "oh look at this new thing we discovered, you don't block and instead provide a function to be called later". And many older folks probably looked at each other and said "Wait, what year is it?"
In CQRS/ES you don't usually want to store the state as such, you just store all the logical events which lead to a certain state. While the Datomic approach is certainly valuable for certain scenarios if you want to query historical data, it's less so if you want to know why something looks the way it currently does (in terms of the domain).
(At least that's my understanding of Datomic, I may be mistaken.)