Is my mediator layer a sensible way to manage this scenario using the Single Responsibility Principle?
I’m not sure how to start to explain my question, but here goes.
Is there an “ask for only what you need” interface principle?
I have grown into using a principle for designing and consuming interfaces that says basically, “ask for only what you need.”
Should concrete classes avoid calling other concrete classes, except for data objects?
In Appendix A to The Art of Unit Testing, Roy Osherove, speaking about ways to write testable code from the start, says,
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 the option to close a started ProjectTask
is never available, but some safeguards are present in the domain:
How to verify the Liskov substitution principle in an inheritance hierarchy?
Inspired by this answer:
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 might go wrong if I as a developer do not think about the principle while writing object-oriented code.
Are injectable classes allowed to have constructor parameters in DI?
Given the following code:
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.
Tension between the dependency inversion principle and avoiding “new” in C++?
I have seen a lot of advice that it is better to do Type object;
than
LSP vs OCP / Liskov Substitution VS Open Close
I am trying to understand the SOLID principles of OOP and I’ve come to the conclusion that LSP and OCP have some similarities (if not to say more).