All Questions
Tagged with initialization object-oriented-design
3 questions
6
votes
4
answers
1k
views
How to avoid init methods when 2 objects need the reference of each other?
According to https://softwareengineering.stackexchange.com/a/334994/432039, I know init is a code smell and should be avoided, and one of the solutions is to use a builder to hold the state first ...
3
votes
3
answers
1k
views
Is there any performance hit associated by the definition of a static constructor or due to availability of it?
This question is mostly related to the way language implementer do implements static class initalization (pretty specialized question). It is for curiosity and also to potentially improve my code to ...
7
votes
4
answers
3k
views
Separation of construction and initialization
I'm confused by this post by Mark Seeman.
And his comment on IInitializable below:
The problem with an Initialize method is the same as with Property
Injection (A.K.A. Setter Injection): it ...