Most voted "solid" questions
SOLID is an English acronym by Michael Feathers that brings together the 5 Basic Principles of Object-Oriented Programming: Single Responsibility (Single Responsibility), Open-closed (Open-Closed), Liskov substitution (Liskov Substitution), Interface segregation (Interface Segregation) and Dependency inversion(Dependency Inversion)
Learn more…26 questions
Sort by count of
-
25
votes2
answers2094
viewsPrinciple of Liskov’s replacement
Liskov’s substitution principle says that if given types T and S being S subtype of T then S should be replaced by T. My understanding is that if I have an instance of S then I can use it in places…
-
23
votes2
answers2818
viewsWhat is "Inversion of Dependency Principle" (DIP)?
I’m getting to know the beginning now SOLID: S Single Responsabilty Principle The Open/Closed L Liskov Substitution Principle I Interface Segregation D Dependency Inversion Principle However I could…
-
21
votes1
answer1449
viewsWhat are the SOLID principles?
Lately, I’ve heard a lot about the term but for me it’s never clear if it’s a Pattern design or good practice in object orientation. Maybe it’s a very broad question, but why SOLID is useful and…
oop software-engineering solid programming-principlesasked 7 years, 10 months ago ldeoliveira 2,015 -
13
votes3
answers1131
viewsOpen/closed principle - how to understand this?
In object orientation there is SOLID and one of the principles is the open/closed one that I learned as follows: "software components must be open for extension and closed for modification" and…
-
13
votes3
answers818
viewsSOLID is all that they say?
Related: What are the SOLID principles? I ordered my "Agile Principles, Standards and Practices in C#" by Robert C. Martin and one of the reasons is SOLID. But I’m reluctant about SOLID. I don’t…
-
12
votes4
answers549
viewsProblem with polymorphism
I have a polymorphism problem. But before I explain it, I want to make it clear that I’m still learning a lot, so if you want to throw my structure in the garbage, be my guest. I have a project that…
-
7
votes2
answers360
viewsTheoretical doubt - Interface, unique responsibility
Presentation: I created a photo.Cs class that should be responsible for: Calculate the angle of view of the lens; Receive lens zoom (in mm) Receive the cut factor (value multiplied by the lens zoom…
-
7
votes2
answers684
viewsUse of interfaces in domain classes?
The project analyst I’m working on as a C# programmer vigorously defends the concept of SOLID in development. And it says that one of the requirements to use it is to have interfaces for everything.…
-
6
votes1
answer90
viewsHow do I know my function is breaking SOLID POO?
I left a function below that will be the subject of the question, basically I would like to know if this function breaks any principle of SOLID/Clean Code by itself ? This doubt arose because…
-
5
votes3
answers157
viewsWhy does this violate Strict Standards?
take into account the following definitions of classes: class SuperDate {} class SubDate extends SuperDate {} class Foo { public function setDate(SubDate $date) {} } class Bar extends Foo { public…
-
4
votes1
answer52
viewsDoes accessing a variable outside the scope of the class go against SOLID principles?
const clients = [{ username: "test" }]; class Validator { constructor(username){ this.username = username; } isUsernameTaken(username) { let usernames = []; clients.forEach((e) =>…
-
4
votes1
answer66
viewsCan any project be suited to the principles preached by SOLID? What are the steps to this?
I am trying to adapt one of my projects to the standards of SOLID, but I’m not getting out of ground zero. The project in question can be found at: https://github.com/crphp/webservice After some…
-
4
votes1
answer66
viewsFollow the OCP principle or use "instanceof"
The OCP principle preaches: "open to extension, but closed to alteration". To achieve this we need to abstract, because with an abstraction we can extend without needing to change the one that uses…
-
4
votes2
answers123
viewsHow far should we follow OCP?
When developing a screen for a certain part of a system, I come across a classic situation of owning some ifs to determine what action should be taken. I then linked this case to examples of OCP…
-
3
votes1
answer283
views -
3
votes1
answer69
viewsInjection of Dependencies Layers Application / Domain / Repository
In an application using the concepts of DDD I am in doubt about who could inject (dependencies) in a certain class, if there is any standard for such. This is the following between the Application,…
asp.net software-architecture ddd dependency-injection solidasked 6 years, 6 months ago LeoFelipe 1,455 -
3
votes2
answers61
viewsDo generic Helper/Utility classes hurt the Single Responsibility Principle (SRP)?
The classes Helper/Utility with generic methods, which are used for various purposes, violate the Single Liability Principle (SRP)? The following is an example of some methods in the class: function…
-
2
votes1
answer146
viewsCan the controller send an email?
In a controller called activities, I have a method called reminder. This method, receives an id, looks for that activity based on that id and sends an email to the moderator of that activity with…
-
2
votes2
answers100
viewsSRP- Principle of Single Liability
In the Order class, which contain the business rules for requesting a sales order, state which of the options below violates the principle of sole liability (SRP- Single Responsibility Principle)?…
-
2
votes1
answer164
viewsGood practices for class that grows a lot
Supplementing a question I posted here some time ago, about a system for user registration using concepts of the SOLID standard, one of the problems I faced was the question of the User class being…
-
2
votes1
answer663
viewsCheck if the driver has a public constructor without parameters
Someone helps me, I am creating a project and in the dependency injection part I am having the following error when I make a Postman request in my Api: An error occurred when trying to create a…
-
1
votes0
answers29
viewsSolidworks PDM API - Iedmbomview.Getrows does not return the same items to the BOM that are in the PDM
I have a C# routine that exports BOM, but when Validei, the 2 items marked in the image are not returned by the Getrows routine of the Iedmbomview class. Items are normal in Solidworks. And when I…
-
1
votes1
answer441
viewsAbstraction of the PHP PDO Connection class
Staff I have the following class for database connection... namespace App\Database; class Conn { public static function getDb() { return new \PDO('mysql:host=localhost;dbname=dkse','root','root'); }…
-
0
votes0
answers24
viewsA Restcontroller bean at the same time being a Configuration bean and a Component bean hurts SRP?
In a Java application with Spring I came across a class annotated as follows: import ... @Component @RestController @Configuration public class MySender { ... } At first glance I suspected that…
-
0
votes1
answer155
viewsSOLID Principles within Laravel Controller
Within SOLID principles, how to implement the first 2 principles ? SRP and Open-Closed Principle. My structure is simple, it has models within the app generated by Artisan, and simple controllers.…
-
-2
votes1
answer106
viewsWhat can be done to improve this code?
class Curso { public List<Disciplina> disciplinas; } class Aluno { public List<Disciplina> obrigatorias; public List<Disciplina> optativas; public matricula(){ ... } } class…