in reply to Foo::Button->new vs. newButton()
What if you wanted to use two different classes, both of which wanted to call their constructor newButton? Bad news. By using a method in that namespace, it's easier.
Also, what if you wanted to subclass that class, and add extra behavior during the object instantiation? With named constructors, it's harder.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|