Questions tagged [construction]
The construction tag has no summary.
19 questions
0 votes
2 answers
1k views
Inheritance/Composition VS "Direct Injection Construction"
my following example seems to go into the direction Inheritance VS Composition. But that's not, what i want to ask. I see the concept Inheritance and Composition on one side and the alternative, which ...
4 votes
2 answers
204 views
How to separate construction and runtime logic in iOS?
I've been reading Robert Martin's Clean Code book where it suggests we should separate a programs startup/construction process from its run time logic. In Java (the language the book uses) this ...
3 votes
1 answer
102 views
Testing a class with "prerequisite" methods
I'm working on a class that should manipulate files. Its interface has a Open(string filename) method, and various other methods to retrieve and manipulate the contents. Is it ok to call the open ...
1 vote
0 answers
102 views
clone(serialize) v. serialize(clone)
My objects serialize() method is dependent on a call to its clone() method, because of its options to get rid of unwanted data without changing the original instance: serialize: function(opt_filters) ...
2 votes
2 answers
226 views
Preferred way of handling errors when loading an object from a file
If I want to load an object from a file, there are a number of things that can go wrong. Thus, one needs a way of handling errors when doing so. In some languages, like haskell, one can return a Maybe ...
3 votes
1 answer
2k views
Learning to write DSLs utilities for unit tests and am worried about extensablity
I'm trying to simplify our unit tests with hand written DSL's. So far I have DSL's that walk developers through processing a service after setting up all preconditions and the construction of an ...
-2 votes
4 answers
4k views
Why must a constructor's call to the superconstructor be the first call?
It is an error if you do anything in a constructor before calling the superconstructor. I remember that I had problems because of that. Yet, I do not see how this saves us from errors. It could save ...
31 votes
3 answers
4k views
Is a "start", "run" or "execute" method a good practice?
I'm currently working on a code base that has many classes that implement a Start method. This seems like two-phase construction to me, which I had always considered a bad practice. I can't tell the ...