open-closed-principle Questions
1
Solved
In the book I use to prepare for the new Oracle Certified Professional - Java SE7 Programmer exam, in the section that deals with method overriding, I have come across the following:
The overrid...
Bunns asked 29/10, 2013 at 13:38
2
Solved
I have a simple program which draws geometrical figures based on mouse data provided by user.
I've got one class which handles the mouse tracking (it gets the List with mouse movement history) and ...
Bribery asked 14/4, 2013 at 10:30
5
Solved
The Open-Closed Principle states:
software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification
I'm designing a domain right now and includin...
Pad asked 4/9, 2012 at 1:44
3
Solved
I'm trying to grasp the Open/Closed principle (in my case for PHP, but that shouln't really make a difference).
The way i understand it is that a class is never open for modification. Only for bug...
Khelat asked 23/5, 2012 at 20:12
3
Suppose I have the following contrived code:
abstract class Root
{
public abstract void PrintHierarchy();
}
class Level1 : Root
{
override public void PrintHierarchy()
{
Console.WriteLine("Le...
Respondent asked 7/10, 2010 at 16:42
1
I read articles about S.O.L.I.D. but I don't see any difference between OCP and DIP. Look at this example of OCP:
http://www.oodesign.com/open-close-principle.html
The code which holds OCP also...
Fanchon asked 30/11, 2011 at 15:8
5
Solved
I am configuring Automapper in the Bootstrapper and I call the Bootstrap() in the Application_Start(), and I've been told that this is wrong because I have to modify my Bootstrapper class each time...
Esme asked 27/11, 2009 at 7:49
2
Solved
I've been reading up on unit testing, TDD, and the SOLID principles and I need some clarification. My understanding is that if one adheres to the open/closed principle, unit testing could become la...
Rabiah asked 26/10, 2011 at 14:20
3
Solved
There has been a lot of discussion on the subject of “Open Closed Principle” on stackoverflow. It seems however, that generally a more relaxed interpretation of the principle is prevalent, so...
Qualifier asked 28/8, 2011 at 17:26
1
Solved
I was refactoring some old code of a simple script file parser when I came across the following code:
StringReader reader = new StringReader(scriptTextToProcess);
StringBuilder scope = new String...
Taconite asked 24/3, 2011 at 8:28
2
Solved
I've seen and worked with a lot of older, JDBC-based DAO code that usually start out with CRUD methods. My question relates specifically to the retrieval methods, or 'finders'. Typically what I fin...
Gelatinize asked 17/2, 2011 at 7:27
2
Solved
I'm trying to figure out how this would be done in practice, so as not to violate the Open Closed principle.
Say I have a class called HttpFileDownloader that has one function that takes a url and...
Counterpressure asked 20/3, 2010 at 15:32
9
Solved
I've been thinking about this object oriented design question for a while now and have unable to come up with a satisfactory solution, so thought I'd throw it open to the crowds here for some opini...
Neubauer asked 18/9, 2008 at 9:17
6
This question is not about what OCP is. And I am not looking for simplistic answers, either.
So, here is why I ask this. OCP was first described in the late 80s. It reflects the thinking and...
Selfgovernment asked 12/9, 2009 at 23:44
7
Solved
The open-closed principle states that "Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification".
However, Joshua Bloch in his famous book "E...
Cyprinoid asked 18/3, 2009 at 12:8
2
Solved
Is it possible to implement the Visitor Pattern respecting the Open/Closed Principle, but still be able to add new visitable classes?
The Open/Closed Principle states that "software entities (clas...
Beniamino asked 5/10, 2008 at 9:37
© 2022 - 2024 — McMap. All rights reserved.