If I understand this correctly, I would make separate static factory methods to
create instances. It is easier / cleaner IMHO if you define your final objects
as interfaces then you can supply different implementations depending on some
state.
In my current project I'm making API interfaces for
Hi there,
I've bumped into a pretty trivial problem, but probably I've got a dumb day
today — can't find a solution :(
How does one write a method which can be called either over an instance, or
over a class, in which case it would automatically use a default instance? Like
this, in pseudo-cod