Skip to main content

Questions tagged [solid]

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

7 votes
3 answers
551 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
0 votes
2 answers
346 views

I have a question about setting up my service. My main concern is if the design is clean and in order. Whether it meets the SOLID principles and does not spill out on me. I have entities like order ...
Petr Klekner's user avatar
3 votes
7 answers
564 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
4 votes
3 answers
3k views

Description I want to create an instance of an object at runtime, however, the parameters used to create the object are not always the same. To help explain, I have created a simplified example (in ...
zwoolli's user avatar
  • 151
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
1 vote
1 answer
458 views

For a long time, I’ve been using Repository pattern to abstract data access logic from actual business logic, always using SQL or noSQL databases as my data source. But how much valid is it, to ...
Hexley21's user avatar
  • 127
0 votes
1 answer
260 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
5 votes
7 answers
587 views

Consider the following scenario. I have an interface IService: public interface IService { void DoSomething(); } with an implementation: public class Implementation : IService { // This might ...
Codisattva's user avatar
1 vote
3 answers
269 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
3 votes
2 answers
266 views

There's lots of questions about the open-closed principle here, but none that I found satisfied this particular problem. At $job, I'm teaching my team Rust, but I believe the nature of this question ...
amateurece'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
2 answers
418 views

From Liskov Substitution Principle, I am still not very clear about the invariant rule. I read through many posts but I still have doubts. My example is picked from this blog, the example is slightly ...
riki's user avatar
  • 149
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
2 votes
2 answers
2k views

I'm trying to experiment with SOLID in order to get a better grasp of its' concepts. With that in mind, I'm making a card game project. There's a GameUtils project that contains the following classes:...
CBredlow's user avatar
  • 131
-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

15 30 50 per page
1
2 3 4 5
28