in reply to Re: Moose and BUILD
in thread Moose and BUILD
My example above is very simple code in which transforming the input 'x' into the final attribute value 'y' is trivial. Assume instead it's not trivial to transform the input 'x' into the final value 'y'. In this case, you would be doing the transform work twice if you build the parent, then build the child and change the value the parent arrived at. It could be done, but it strikes me as poor code.
My concept here, and perhaps I'm approaching it wrong, is that if the base class were to be instantiated, the input 'x' value would be provided. However, if the sub class were instead instantiated, I would like to lock a particular input value of 'x' in.
|
|---|