Approach for rewriting NUnit tests after refactoring method [closed]
Closed 5 days ago.
Why is “dependency injection” ok, but not “the opposite of preserve whole object (pass required parameters only)”?
According to Why should I use dependency injection?, “dependency injection” has some advantages, for example:
Is “parallel composition hierarchies” a code smell?
For example, suppose I have some mobile apps that uses some user data, the data class:
Is it still “feature envy” if the state to make decision or the action to take after asking the state involves other classes to participate?
According to https://softwareengineering.stackexchange.com/a/212130/432039, if a class asks another class for the state, and then call methods of that class, it is called “feature envy”, eg:
How to avoid init methods when 2 objects need the reference of each other?
According to https://softwareengineering.stackexchange.com/a/334972/432039, I know init is a code smell and should be avoided, and one of the solutions is to use a builder to hold the state first instead of create the object first and then set the state, like https://softwareengineering.stackexchange.com/a/452495/432039 mentions, eg:
Is setting a flag in a loop a code smell?
I have a loop that I am testing a condition in but if the condition is not met then after the loop is complete, I want to execute another code block:
Is depending on lazy loading a code smell?
During my short experience with DDD I often find myself in the situation where I wished for some type of lazy loading mechanism to solve some dangerous cases where large nested data sets might be loaded.
Lots of classes with only one single static method with same name as class – Code smell? [duplicate]
This question already has answers here: Single Responsibility Principle – How Can I Avoid Code Fragmentation? (8 answers) How to determine if a class meets the single responsibility principle? (9 answers) Closed 10 years ago. I’m trying to follow the single responsibility principle (SRP) in my applications. I have lots of CRUD classes I just […]
Is it a code smell if you are frequently creating an object just to call a method on it
I inherited a code base where there is a lot of code that goes something like this:
Is it a code smell if you are frequently creating an object just to call a method on it
I inherited a code base where there is a lot of code that goes something like this: