Comment by Filip Milovanović on Passing info between different branches of a...
If there is no compelling reason (such as polymorphism) to make all the algorithms have the same interface (execute()), then I would actually prefer option 3, except that I'd only pass the state (a...
View ArticleComment by Filip Milovanović on Handling class specific behavior:...
Be aware that your two options (which may also appear in other guises) involve a tradeoff: with polymorphism, the abstract interface gets harder to change the more client and component classes you...
View ArticleComment by Filip Milovanović on Split single repository/service into pieces...
The idea to have a repo per endpoint (or better, per use-case) is fine. In a strongly typed language, you might also do this separation on the interface level, but potentially allow one repo to...
View ArticleComment by Filip Milovanović on Must getters return values as is?
A getter is a part of the public interface of a class. The public interface defines how the class communicates with the outside world, allowing you to change the underlying (internal) representation if...
View ArticleComment by Filip Milovanović on What is "vibe coding" and what are the strong...
According to Wikipedia, it's not really coding, in the sense that one does not actually write any code, but develops an app by hoping an AI will spit out something kind of usable based on a descriptive...
View ArticleComment by Filip Milovanović on how can CQRS improve performence when we have...
It's not necessarily an architecture (or a pattern, however you want to think about it) that's suitable for everything. Think for example, about a scenario where you have different access patterns /...
View ArticleComment by Filip Milovanović on how can CQRS improve performence when we have...
"Have you ever noticed that some kinds of money will show you the face of the current monarch?" - I'm guessing people who don't live in a monarchy aren't likely to notice this, but nice example :D
View ArticleComment by Filip Milovanović on In "disadvantages of global states", what is...
The behavior is not literally unpredictable - if you keep track of all the relevant information. But, that means you'd have to find all the hidden dependencies, and keep track of a myriad of ways these...
View ArticleComment by Filip Milovanović on Is it valid for two small aggregates to have...
You can load database entities partially into different objects or aggregates based on context, and have different behaviors when writing them back. You can also consider relying on the compiler to...
View ArticleComment by Filip Milovanović on Difficulty understanding benefit of...
@Basilevs - that's only if you assume that you need to guess it all up front. It's meant to be the result of an iterative process.
View ArticleAnswer by Filip Milovanović for When is multiple validation layers of...
Trust No OneAn important guideline is to never trust outside input of any kind - because what's coming from outside the application is not really under your control. A web-based frontend may impose...
View ArticleComment by Filip Milovanović on Naming convention for boolean returning methods
'"Follow you team's guidelines" is not applicable since we have none' - well, then have a meeting and decide how you want to do it (possibly including in what cases it is OK to deviate from that...
View ArticleComment by Filip Milovanović on How to combine multiple functions into a...
"One can see that the two functions are almost similar" - Kent Beck's refactoring mantra is "Make the change easy (this might be hard), then make the easy change". So the first step is to make the two...
View ArticleComment by Filip Milovanović on Modeling invariants that requires data from...
@Basilevs - The idea is to design aggregates so that they reflect the domain, and support the usage patterns in that domain (like, taking into consideration what commonly needs concurrent access by...
View ArticleComment by Filip Milovanović on Modeling invariants that requires data from...
This perspective might be helpful: in the end, it's all just a bunch of objects and functions that are termed differently depending on their role in this particular modeling paradigm. Value - a simple...
View ArticleComment by Filip Milovanović on Is This Programming Paradigm New?
This is pretty cool. I don't know if it's a new paradigm (then again, it's hard to precisely define what a "paradigm" is exactly), but it does have aspects you can expand on further - I'd like to...
View ArticleComment by Filip Milovanović on Should code reviewers reproduce the...
And when QA returns faulty code, how does this boss imagine the fixes happen? Magic? God knows what they think "reproduce the problem" mean - they might be objecting to something that only exists in...
View ArticleComment by Filip Milovanović on Difficulty understanding benefit of...
And, though you legitimately could, you don't have to stop there. Maybe you want to separate the actual traversal from invoking the action, because you need to use the "getting the next node"...
View ArticleComment by Filip Milovanović on Naming convention for boolean returning methods
'"Follow you team's guidelines" is not applicable since we have none' - well, then have a meeting and decide how you want to do it (possibly including in what cases it is OK to deviate from that...
View ArticleAnswer by Filip Milovanović for Repository and Service Interfaces in an...
My main confusion is about where to define interfaces for repositories and services.Generally speaking, in component design, there are two categories of interfaces - (1) provided interfaces (those that...
View Article