The design-principles tag has no wiki summary.
5
votes
4answers
761 views
“Extends is evil” vs. OCP?
As far as I have understood(?), the "Extends is evil" idea is in direct opposition to the Open Closed Principle?
In here, the concept of OCP is presented as inherently using Extends:
...
1
vote
1answer
143 views
Component design: getting cohesion right
I currently have a set of components named DataValues, ValueParsers, ValueFormatters and ValueValidators. The first one defines an abstract base class DataValue and contains a whole load of ...
12
votes
6answers
770 views
Loose Coupling in Object Oriented Design
I am trying to learn GRASP and I found this explained (here on page 3) about Low Coupling and I was very surprised when I found this:
Consider the method addTrack for an Album class, two possible ...
8
votes
3answers
355 views
Two contradicting definitions of Interface Segregation Principle – which one is correct?
When reading articles on ISP, there seem to be two contradicting definitions of ISP:
According to first definition ( see 1, 2, 3), ISP states that classes implementing the interface shouldn't be ...
-2
votes
1answer
90 views
What are general best practices for plugin/extension development? [closed]
I need to correlate requirements for a plugin/extension of an application with development best practices.
I thought there might be best practice advice that applies to plugins and extensions ...
2
votes
3answers
146 views
Abstracting out a module or using the Module Singleton directly?
I am working on a module which is dependent on other module for some functionality. Now the dependent module provides a lot of functionality and I need only few of them, hence got the idea to create ...
7
votes
3answers
372 views
Is it a basic principle, or highly desirable, to have class methods that return “$this” rather than a value?
I've really just begun to learn OOP. I started about a year ago and have written probably 15,000 lines of it. But I wrote it all with hardly any experience looking at other people's OOP.
Most of my ...
13
votes
4answers
1k views
How does the Law of Demeter apply to object-oriented systems regarding coupling and cohesion? [closed]
How does the Law of Demeter applied to object-oriented systems with coupling and cohesion?
I was reading a book "Software development and professional practice" and came across the chapter about LoD, ...
3
votes
4answers
103 views
Feature organization / authentication?
Let's say I have a product that has different features, or different feature access depending on things (i.e Premium User, Beta, Demo, Logged-in User, etc..).
What's the best way to organize a system ...
39
votes
2answers
3k views
Are there any OO-principles that are practically applicable for Javascript?
Javascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by:
Writing the functions to be used as classes by yourself
Use a nifty class system ...
2
votes
5answers
264 views
Is there a term for “Use procedures that execute a single task”?
I'm having a discussion with a fellow developer, and I'm trying to argument this in something like a short "term".
SoC (Separation of Concerns) is pretty straight forward design practice, but it ...
11
votes
2answers
473 views
Does Liskov Substitution Principle also apply to classes implementing an interface?
LSP states that classes should be substitutable for their base classes, meaning that derived and base classes should be semantically equivalent.
But does LSP also apply to classes implementing an ...
16
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 ...
9
votes
5answers
951 views
When to stop inheritance?
Once upon time ago I asked a question on Stack Overflow about inheritance.
I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still ...
2
votes
3answers
534 views
Recommended content for layers
As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions
I now wish to know if I am putting the right functionality in ...
2
votes
2answers
129 views
Where does “isolating complexities” lie in the realm of design principles?
I was just curious, it's something I think most people are aware of as a technique:
You have some abominable data that simply must be parsed and you can do nothing to simplify the algorithm for doing ...
4
votes
2answers
185 views
Does the single responsibility principal promote flexibility?
Does the single responsibility principal promote flexibility? If not what are the other methods to make your classes more flexible?
By flexibility I mean, a class is able to function correctly at any ...
4
votes
2answers
153 views
Does KISS encourage tools and frameworks that expose complex leaky abstraction layers?
Tools and frameworks make complex tasks simple. This seems like something that would be supported by KISS(keep it simple stupid). Tools and frameworks also have the potential to introduce leaky layers ...
6
votes
5answers
288 views
Please help me give this principle a name [closed]
As a designer, I like providing interfaces that cater to a power/simplicity balance. For example, I think the LINQ designers followed that principle because they offered both dot-notation and ...