Comment by Filip Milovanović on Does a server send a client a ServerMessage,...
@aioobe No, this answer rejects the premise of the question. There's a difference. I'm not addressing the question explicitly asked, but the flaw in the underlying thinking. What you propose is an...
View ArticleAnswer by Filip Milovanović for In unit testing: How to abstract a dependency...
Mark Seemann makes a good point, but it's important to not take these things as a universal law, and understand them with more nuance. Your GetMenuList method might be too simple for this to apply, but...
View ArticleComment by Filip Milovanović on If class B extends A, can we say that B...
"A dependency is an external component that is referenced within a class' definition." - but, that covers inheritance. You reference by name another type (an external component) in the definition of...
View ArticleComment by Filip Milovanović on Does ReactJS Compound Pattern violate the DRY...
"But doesn't this violate the DRY principle? Now we have to copy everywhere the ordering logic of the elements" - No, you (as a developer making choices) are violating the DRY principle. You don't have...
View ArticleComment by Filip Milovanović on TDD and code reusability
You design the new component so that the reusable part is constructor-injected into it. In the test suite for the new component, you only write tests for the behavior that strictly relates to the new...
View ArticleComment by Filip Milovanović on What Are The Differences Between Sociable...
Can't know for sure, but the term "sociable" tests was probably popularized by Martin Fowler, so maybe this article of his can shed some light (scroll down a bit). It's really more of a style of...
View ArticleAnswer by Filip Milovanović for In "Liskov Substitution Principle", is...
Typical online accounts of LSP are often simplified or handwavy, or lack context, so you have to keep in mind that some of the stuff that you can find out there is not necessarily 100% representative...
View ArticleAnswer by Filip Milovanović for Why is "hidden dependency" (required things...
First some context - these named refactorings (from Refactoring by Martin Fowler) aren't necessarily meant to tell you what's better design-wise, they are just things that you can do to transform your...
View ArticleComment by Filip Milovanović on In "avoid primitive obsession", what is the...
'"string with ZipCode" [...] is simpler and [...] more understandable, especially for the business analyst that have less IT background.' - you do know that in normal conversation (as well as in pretty...
View ArticleComment by Filip Milovanović on Is there a term that's kind of the opposite...
Yeah, it's called "breaking changes". If you make mandatory something that was previously optional, you are going to break people's code. It's like having two overloads of the same function and then...
View ArticleComment by Filip Milovanović on Model-Driven Development & PBI's / User Stories
There was some miscommunication going on here, which is not unusual, so you ended up doing more work then you were required to. The takeaway is to assume less and ask more clarifying questions. Also,...
View ArticleComment by Filip Milovanović on Why is "dependency injection" ok, but not...
@Basilevs - one does not "leak abstractions", one makes "abstractions" that are leaky, there's a difference. I.e., they aren't designed and maintained with enough thought and are leaking details.
View ArticleComment by Filip Milovanović on OOP Design of a Mathematical Group
Consider also not modeling the Group explicitly, and only having the Element class, with the operations mul and exp defined on it (might internally call to some helper function, or consult a table or...
View ArticleComment by Filip Milovanović on What do you call an enum that translates its...
Note that this is not unlike having a constructor (or a static factory method) on an ordinary class. It's just that the syntax is a little different as it is a different language construct.
View ArticleComment by Filip Milovanović on Are there any studies on the efficacy of...
For what it's worth, IMO the static code analysis linters do is helpful. The enforcement of style standards not so much, unless it's a team of complete newbies who can't understand code not written in...
View ArticleComment by Filip Milovanović on Database for storing large trees
You can maybe look into graph databases
View ArticleComment by Filip Milovanović on Why is global state hard to test? Doesn't...
@Steve - I'm not saying this is specific to global state, I'm pointing out to the OP that this is also a possibility, in response to their idea that the problem will be solved by just "writing all the...
View ArticleComment by Filip Milovanović on Does ReactJS Compound Pattern violate the DRY...
"But doesn't this violate the DRY principle? Now we have to copy everywhere the ordering logic of the elements" - No, you (as a developer making choices) are violating the DRY principle. You don't have...
View ArticleComment by Filip Milovanović on If class B extends A, can we say that B...
In any case, what I was trying to say is that one needs to go back to this broader meaning when trying to make sense of things like "dependency inversion", or "direction of dependencies", or coupling...
View ArticleComment by Filip Milovanović on Exposing dependencies results in "fat"...
Next, you should take the fat constructor as a signal, an indicator telling you that your class is trying to do too much on its own, and decompose it, so that it delegates the details of various tasks...
View Article