Reduce / fold from #FP is incredible…
Given some initial state, and a new event / command / action / update, get the next state.
Understand that, and you might never want to throw out the events / commands / actions / updates again!
| Website | https://theaidia.com |
| Fave Language | Typescript |
| Fave Cloud | AWS |
| Fave Stack | Event Sourced Microservices |
@leviramsey @adymitruk @brandonmull
Wow.. I totally missed that comment 😂
@leviramsey @adymitruk @brandonmull
That works if you only have one read model that’s affected. When you have hundreds…
@ruthpozuelo few thoughts:
1. I’m assuming this class will be consumed by other classes? If so, I’d make sure the other classes have a little more definition (ie, UserPersistence class uses this and manages persisting users). These follow up classes should be independent from the storage method in their public apis so you can rotate the persistence method out later.
2. Rather than saving the data to the class itself, I’d consider returning the data to be consumed by something else.
@ruthpozuelo
3. I’d be very careful about what actually has access to this class - unsanitized string injection makes you ripe for attacks 🤪
Finally, the original question, it’s fine that these are in a single class - it groups the functionality together. Personally, I enjoy creating function modules for the same purpose, but I also prefer FP to OOP in general.
Synonyms of accountable from thesaurus.com:
Answerable
Culpable
Liable
Obliged
Synonyms of dependable:
Loyal
Staunch
Steady
Sturdy
True
Trustworthy
Amazing how people forget that there is a connotation and not just a denotation - the thesaurus always helps to make it more clear 🥲.
Reduce / fold from #FP is incredible…
Given some initial state, and a new event / command / action / update, get the next state.
Understand that, and you might never want to throw out the events / commands / actions / updates again!
@nickthefox check out https://vim-adventures.com
RPG that teaches vim- what’s better than that?