Questions tagged as 'solid'

2
answers

What is the "Principle of Dependency Inversion" (DIP)?

I am now familiar with the SOLID principle: S Single Responsabilty Principle O Open / Closed L Liskov Substitution Principle I Interface Segregation D Dependency Inversion Principle However, I could not understand the...
asked by 02.12.2015 / 16:58
1
answer

What are SOLID principles?

Lately, I've heard a lot about the term but for me it's never clear whether it's a design pattern or a good practice in object orientation. It may be a very broad question, but why SOLID is useful and when should we use it? In particular wh...
asked by 20.01.2017 / 12:48
3
answers

Principle open / closed - how to understand this?

In object orientation there is SOLID, and one of the principles is the open / closed principle that I have learned as follows: "software components must be open for extension and closed for modification", where components include classes, methods...
asked by 13.05.2014 / 13:24
2
answers

Theoretical doubt - Interface, single responsibility

Presentation: I created a class fotografia.cs that should be responsible for: Calculate the angle of view of the lens; Lens zoom (in mm) Receive the cut factor (value multiplied by the zoom of the lens shows the actual lens value)...
asked by 24.03.2014 / 14:52
3
answers

Why does this violate the Strict Standards?

Consider the following class definitions: class SuperDate {} class SubDate extends SuperDate {} class Foo { public function setDate(SubDate $date) {} } class Bar extends Foo { public function setDate(SuperDate $date){} } $foo = new...
asked by 19.02.2014 / 20:42
1
answer

Can a Repository extend a Model?

If the Repository extends to Model User, am I breaking some of the principles of S.O.L.I.D? I've seen some tutorials talk, that I have to create an abstract class with the same methods as Eloquent, does not that apply to KISS principles? A...
asked by 07.06.2017 / 21:00
1
answer

Can the controller send email?

In a controller called activities, I have a method called reminder. This method, receives an id, searches for that activity based on this id and sends an email to the moderator of that activity with data of the same. Is this method with 'too muc...
asked by 06.12.2014 / 20:05
1
answer

Good practices for growing class

Complementing a question that I posted here for some time, about a system for registering users using SOLID standard concepts, one of the problem I came across was the question of the User class being very large and can be very variable, one O...
asked by 01.10.2018 / 20:18
2
answers

SRP- Principle of Single Responsibility [closed]

In the Request class, which contains the business rules for requesting a sales order, please inform which of the following options violates the principle of single responsibility (SRP)? Request.AddItem (): Order.ApplyDiscount (); Order.S...
asked by 02.04.2018 / 07:40
1
answer

Injection of Dependencies Layers Application / Domain / Repository

In an application using the DDD concepts I am in doubt about who could inject (dependencies) into a particular class if there is any standard for it. This is between the Application, Domain, and Repository layers. 1) AnAppService Client (A...
asked by 03.05.2018 / 12:46