[Tutor] constructors
Erik Price
erikprice@mac.com
Tue, 9 Apr 2002 22:34:37 -0400
When writing a class, is it recommended to always take advantage of
constructors? I have written a class called Person, which helps me to
organize my user-input error-checking (by confining error-checking
functions to the methods that set instance attributes). I don't have a
constructor, because sometimes I use this class to build a new Person
and sometimes I use this class to pull an already-existing Person's
attributes from a database table. But constructors are seen as a
"really good thing", but as far as I can see a constructor is just a
shortcut. Please share your thoughts on using constructors, if you
would?
Thank you,
Erik