That gradual change is something I'm not completely happy with - only I fail to come up with a better solution.
Moose did change the convention only a bit: It offers its own new with a key/value API, but also has BUILDARGS and other magic like coercions which allow to mimic practically any existing constructor API. Corinna will not provide the same helpers for backward compatibility. I guess I can live with that, because during the last decade or so I adopted the key/value style anyway.
The "bless vs. new" thing has hit me a lot harder in situations where serialization of objects is needed. Even complex Moose objects can be built from e.g. JSON or YAML strings, and then blessed into the appropriate class. This is no longer possible with Object::Pad or Corinna: You can (re)create their objects only by calling new, undergoing the same API restrictions and validations as for fresh objects. If an object, during its lifetime, achieves a state which is not available by calling new, then... object persistence gets a lot harder.
| [reply] |
At $job - 1, we used Moose, but new_from_foo in a Class wouldn't have passed a code review. The correct way was to introduce a Class::Builder::FromFoo which took foo as the constructor parameter and provided a build method; thus following the Builder pattern.
I'm not sure there's a similar pattern for with_bar, I've never needed it there.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] [select] |