Skip to main content

Questions tagged [solid]

Mnemonics for set of design principles: Single responsibility, Open-closed, Liskov substitution, Interface segregation, Dependency inversion

Filter by
Sorted by
Tagged with
7 votes
3 answers
546 views

The Java List<E> interface includes methods, such as add(E) and remove(Object), that work as the names suggest on instances of mutable concrete implementations, such as ArrayList<E> and ...
Ellen Spertus's user avatar
3 votes
7 answers
555 views

I'm working on a custom Magento 2 module in my internship, and I'm trying to follow SOLID principles in my code. Right now, my controller actions handle everything: getting request data, processing it,...
Ruben Eekhof's user avatar
5 votes
4 answers
958 views

Specific example question: I am writing multiple different software packages, in different repos, that each do different things. Many of these packages produce something that we want to visualise/plot....
armoured-moose's user avatar
0 votes
1 answer
255 views

I'm working on an ASP.NET Core application that uses Identity for user management. I have an AccountService with a Register function, where I accept a RegisterBaseDto that contains the role ...
Marko Sami's user avatar
1 vote
3 answers
268 views

According to Invariant rule in Liskov Substitution Principle, I know one of the form of violation of "Liskov Substitution Principle" is violating "invariants can't be weakened in a ...
wcminipgasker2023's user avatar
0 votes
2 answers
147 views

I have long standing argue about dependency injection and SOLID principles with my teammate. We both want to make an Exporter, to export data into various formats. My approach (in PHP): class Exporter ...
JohnyProkie's user avatar
3 votes
4 answers
272 views

If you have a class representing your applicative config file. Instead of injecting that config class everywhere, would it be good application of interface segregation principle to expose several ...
Calimero's user avatar
  • 141
-1 votes
1 answer
170 views

Let's say that I have a class with a service that is going to be injected at runtime: class Thing { private magic: IMagic; // Magically injected service public doStuff(){ // Do a lot ...
Tizio Fittizio's user avatar
2 votes
5 answers
614 views

I've generally understood the SRP to roughly mean: Each class should do one thing Exactly what "one thing" is is up for debate. However, I've recently seen claims that the entire SRP has ...
ScottishTapWater's user avatar
1 vote
3 answers
116 views

I have Controller that basically publishes different Event based on some input criteria, simplified version of the logic is here: [HttpPost] public async Task<ActionResult> Create(...
Velocoder's user avatar
  • 129
2 votes
2 answers
451 views

According to Is this a violation of the Liskov Substitution Principle?, as I understand, the top answer currently says the code below is violating "Liskov Substitution Principle": public ...
wcminipgasker2023's user avatar
2 votes
1 answer
2k views

How to apply clean architecture concepts in a software that depends on External APIs. Example: A business that offers some kind of subscription to its users. Its convinient to store some subscription ...
Rafael Alencar's user avatar
1 vote
4 answers
409 views

Edit based on responses so far I am starting with an edit so as to save future contributors from going down the same path others have. I am only interested in contributions that stick to the exact ...
Ash's user avatar
  • 219
4 votes
1 answer
293 views

In MVC, I often seen all models in a models.py module, all views in a views.py module, and the controller - you guessed it - in a controller.py module. In other projects, I sometimes see all exception ...
Chewers Jingoist's user avatar
5 votes
4 answers
577 views

I often write front end apps with a generic MVC pattern. I use javascript but this questions is language independent and relates to OOP as a whole. I struggle to understand the SRP principle and I ...
Kevin Greetham's user avatar
3 votes
1 answer
296 views

Let's say we have the following business requirements: We have a list of dishes. They have a name and a list of ingredients. The restaurant owner always wants to have a dish (and only one) marked as ...
Antonio Gamiz Delgado's user avatar
0 votes
1 answer
579 views

I have just recently joined a new company and one of the classes used to log information has not been written properly. So I have been asked to add new functionality to the logger. Rather than ...
user16405900's user avatar
10 votes
3 answers
4k views

[I'm using the term interface here with C#'s interface in mind. I won't tag the question with a C# tag because it really isn't a C# question.] In my work we do unit and integration tests but we don't ...
underthevoid's user avatar
1 vote
1 answer
2k views

I'm currently reading "Clean Code" by Robert Martin (which I should have read years ago), and it's given me a bit of a wakeup call, especially regarding keeping methods and classes small, ...
Andrew Stephens's user avatar
3 votes
3 answers
487 views

I have read in an article DIP in the Wild that "When Robert Martin first discussed the DIP, he equated it a first-class combination of the Open Closed Principle and the Liskov Substitution ...
bridgemnc's user avatar
  • 261
14 votes
5 answers
4k views

I am reading about the SOLID principles, but it seems like the Liskov-Substitution Principle primarily refers to programs that use inheritance. From my understanding people are shifting more towards ...
Eric Gumba's user avatar
0 votes
3 answers
165 views

I'm curious about your thoughts on this subject that we have discussed with the people around me. Especially at the architectural stage, in which layer is the most optimal and efficient way to use the ...
mtulun's user avatar
  • 13
1 vote
2 answers
119 views

There is a bunch of books that state principles about good code (SOLID, DRY, Design patterns etc.) Those principles are solutions to some problems. An application of those principles could go like ...
SomeThoughts's user avatar
1 vote
1 answer
369 views

I have a Dao interface which doesn't have any methods defined. Then I have multiple classes which implement this interface, like PetDao and HouseDao. For some of the implementation classes, and some ...
Pepit's user avatar
  • 13
0 votes
2 answers
140 views

So basically the ISP states we should break big interfaces with members that are not cohesive with each other to smaller and more cohesive interfaces, which is very close (if not the same) to what is ...
underthevoid's user avatar

1
2 3 4 5
9