On 05/26/2013 11:53 PM, Vicente J. Botet Escriba wrote:
Le 26/05/13 22:45, Gaetano Mendola a écrit :
On 26/05/2013 22.01, Vicente J. Botet Escriba wrote:
Would the base Latch class be public? if not, this is an implementation detail and is equivalent to having two classes but sharing a common implementation.
Well, not equivalent because with let say a boolean as parameter you need to check at runtime what to do (reset the counter or not) this way with a policy the choose is made a compile time, also implementing it with a boolean will force you to store anyway the original counter value, NoResetPolicy to the other side will be an empty class. I said "equivalent to having two classes".
And it's even a vantage due the fact they share the implementation. Regards Gaetano Mendola