Questions tagged [SOLID] (21)

5
answers

What is a SOLID and how it can be used in web development?

Good day! Actually the question sounded in the subject. The only thing I will add that link and "professorial arrogance" from Wikipedia has already been discussed, but I would like so that even a child can understand what it is and what it is, because I want to achieve a real understanding of the topic. I would be very g...
kennedy.Bahring asked April 18th 20 at 12:31
2
answers

The principle of closeness/openness, how to add a new method?

Good afternoon, chose the PHP tag because I write in php and would be lucky to get an answer to your question. Actually the principle is that the Class should not change but open to extension. How to correctly add a new method to the extended class? to use inheritance or something to offer?
alexandro.Lars asked April 7th 20 at 10:46
3
answers

The principle of DIP of the SOLID and of Autowiring DI container?

The DIP principle States: the dependencies should be on abstractions, not concrete implementations. For example such code: public function __construct(LoggerInterface $logger) { } The dependence on the interface. If you are using DI containers with autowiring to work. To work autowiring need to assigned a specific class a...
Conor asked April 7th 20 at 10:43
1
answer

Can not correctly implement the principle of single responsibility?

Good morning. Increasingly faced with the problem that can not correctly identify the sole responsibility of the adapters and fragments. For example, there are employees adapter, and the adapter clients it takes different models but their content fields are the same and therefore the same witholder and it seems we can use 1...
Dolores.Murray asked March 31st 20 at 15:01
3
answers

What principles of the SOLID is broken?

I decided to go into SOLID, and in particular to make a composition of interfaces to solve the following tasks.There is a Boxin which to place figures, some of these figures implement the interface IShape, that is, can be filled with color, the second part only implements IArea and cannot be filled with color(line, transpar...
Beaulah_Koch asked March 29th 20 at 23:32
3
answers

SOLID.LSP + OOP.Polymorphism = a contradiction?

After studying different sources about the Liskov Principle Substitutioin , and have not found the answer to the question: As the LSP is combined with polymorphism in OOP? After all, judging by definition, an LSP requires the heirs to preserve the behavior (contract) of the base class. While polymorphism is the ability to...
alene_Orn2 asked March 27th 20 at 12:25
1
answer

How to organize code in Django?

Hello! The question for the nuances of following the principles of SOLID in Django. There is a model (schematic) with the methodclass Product(models.Model): name = models.CharField() type = models.CharField(choices=PRODUCT_CHOICES) def process_new_order(self, *args, **kwargs): if self.type == 'type one': """ do order ...
lessie.Parker asked March 24th 20 at 13:30
1
answer

Is the use in a method of the super class() one of the requirements for compliance with the principle of openness/closeness of substitution or Barbara Liskov SOLID?

With colleagues dispute, I want to get to the truth. Here for example is a definition from wiki (SOLID) - The principle of openness/closeness (The Open Closed Principle) "software entities ... should be open for extension, but closed for modification." - The substitution principle Barbara Liskov (of The Liskov Substitution...
Hermann.Heidenreich asked March 24th 20 at 10:57
1
answer

What events in the IoC?

The principle of dependency inversion(IoC) often illustrate this scheme: It is shown that the principle is a collective notion, is some result that can be achieved by applying the technique: service-locator, dependency injection (3 types), delegation events I understand all these techniques in addition to events. Please te...
Linnea9 asked March 23rd 20 at 19:50
2
answers

If the factory method is in conflict with the OCP?

Tell me please, do I understand correctly that the solid principles this is not a recipe for all occasions? And it is quite a common phenomenon - the intentional violation of some solid principles. For example, there is a pattern the factory method. Here is its implementation:class Door: def __init__(self, weight): self.w...
hilma84 asked March 20th 20 at 11:18