1
vote
1answer
95 views

Liskov substitution principle with abstract parent class

Does Liskov substitution principle apply to inheritance hierarchies where the parent is an abstract class the same way if the parent is a concrete class? The Wikipedia page list several conditions ...
3
votes
1answer
172 views

Does this Decorator implementation violate the Liskov Substitution Principle?

Please consider the following implementation of the Decorator design pattern: WordBank objects store strings and return them to the client through the method getWords(). The decorator class, ...
6
votes
3answers
318 views

How to adhere to the open-closed principle in practice

I understand the intent of the open-closed principle. It's meant to reduce the risk of breaking something that already works while modifying it, by telling you to try to extend without modifying. ...
3
votes
2answers
393 views

Aren't decorators easily breaking the ISP?

"The Interface-Segregation Principle (ISP) states that no client should be forced to depend on methods it does not use." The decorator pattern is a design pattern to decorate a method of a class. For ...
4
votes
3answers
273 views

How can I improve this design so that I don't need to dynamically scan classes at runtime?

I'm in the middle of a redesign on the part of my current project that deals with user permissions and authorization. I have an interface named IUserPermissions that encapsulates this information. ...
2
votes
1answer
211 views

Creating an interface of interfaces

Background: We have a class that both listens on a socket and sets values on itself based on what it reads off the socket. I believe that adheres to SRP. To adhere to ISP we created one interface ...
6
votes
2answers
448 views

Is it good to have an interface plenty of methods which belong to different concepts, just to preserve the Liskov's Principle?

I'm currently studying a course based on Software Design and I had a discussion in class with my professor and some classmates about a problem represented by the next scenario: Scenario Imagine ...
3
votes
2answers
292 views

Single Responsibility principle VS KISS principle

Let's assume the modeling of User model in a context of a social network. User concept is composed of two notions: Authentication elements like userName/Password/Email etc... Extra data information ...
3
votes
3answers
437 views

Simple questions to test understanding of Dependency Inversion Principle

I am preparing a short (1-2 hour) presentation about DIP to several (~5) junior developers (1-3 yr xp) in the office. At the end of the presentation I want to know whether they understood what I was ...
10
votes
3answers
720 views

Dependency Inversion Principle: How to define “high-level policy” and “low-level detail” to other people?

I am trying to explain the dependency inversion principle to my (mostly junior) colleagues. How can we define which one is the "high-level policy" and which one is the "low-level detail" in a ...
0
votes
1answer
113 views

What are the reasons for rebuild and redeployment libraries?

It's difficult to understand the meaning of the question from the topic's name. Here is what I mean. I'm watching Uncle Bob's Clean Code Episodes. In many episodes where he is talking about SOLID ...
3
votes
2answers
280 views

Can I apply SOLID concepts to entire solution designs rather than just the internal components?

So maybe the quick answer is 'Yes' absolutely (or no I suppose), but let me explain my question angle to get a better derived answer. We all commonly use SOLID design principals when making up the ...
5
votes
1answer
660 views

Is wrapping a third party code the only solution to unit test its consumers?

I'm doing unit testing and in one of my classes I need to send a mail from one of the methods, so using constructor injection I inject an instance of Zend_Mail class which is in Zend framework. Now ...
18
votes
8answers
2k views

What can go wrong if the Liskov substitution principle is violated?

I was following this highly voted question on possible violation of Liskov Substitution principle. I know what the Liskov Substitution principle is, but what is still not clear in my mind is what ...
11
votes
1answer
633 views

How to verify the Liskov substitution principle in an inheritance hierarchy?

Inspired by this answer: Liskov Substitution Principle requires that Preconditions cannot be strengthened in a subtype. Postconditions cannot be weakened in a subtype. Invariants ...
72
votes
7answers
5k views

Is this a violation of the Liskov Substitution Principle?

Say we have a list of Task entities, and a ProjectTask sub type. Tasks can be closed at any time, except ProjectTasks which cannot be closed once they have a status of Started. The UI should ensure ...
21
votes
11answers
982 views

Choose code design effort or laziness in Bank world

I've worked for two years in a great Investment Bank. I made some technical projects with the desire of creating code the most optimized, respecting the adapted good design patterns, SOLID principle, ...
4
votes
3answers
516 views

Single Responsibility Principle Implementation

In my spare time, I've been designing a CMS in order to learn more about actual software design and architecture, etc. Going through the SOLID principles, I already notice that ideas like "MVC", ...
3
votes
1answer
281 views

Do “Builder” static methods violate SOLID?

I am writing a class which consists mostly of data storage responsibilities. The context for the use of this class will, in general, be retrieving an array of objects of this type for display later. ...
10
votes
3answers
1k views

Applying SOLID principles

I am quite new to the S.O.L.I.D. design principles. I understand their cause and benefits, but yet i fail to apply them to a smaller project which I want to refactor as a practical exercise to use the ...
19
votes
12answers
1k views

SOLID vs. Avoiding Premature Abstraction

I understand what SOLID is supposed to accomplish and use it regularly in situations where modularity is important and its goals are clearly useful. However, two things prevent me from applying it ...
6
votes
2answers
758 views

What does “abstractions should not depend on details” actually mean?

Most readers will be familiar with Bob Martin's famous dependency inversion principle, which states - High-level modules should not depend on low-level modules. Both should depend on abstractions ...
18
votes
4answers
2k views

Solid principles vs YAGNI

When do the SOLID principles become YAGNI? As programmers we make trade-offs all the time, between complexity, maintainability, time to build and so forth. Amongst others, two of the smartest ...
3
votes
4answers
475 views

Which one of the SOLID principles had the largest effect on your code? [closed]

Which if the SOLID principles introduced by "Uncle Bob" Martin had the largest effect on your day to day coding? Please give details!