4 ms·
I don't think there's any use of a heavy pattern in there, it's just leveraging the basic OO idea of state. My rule of thumb is to use class methods as factori
by charlysisto 13y ago
I don't think there's any use of a heavy pattern in there, it's just leveraging the basic OO idea of state.
My rule of thumb is to use class methods as factories to initialize your object in a certain way, which is quit consistent with what the class method `new` does. Once you stay in that line of thought the rest flows quit naturally without over-thinking anything.