[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
Re: Some X++ construction issues.
- To: <node!michael>, <xtech>
- Subject: Re: Some X++ construction issues.
- From: Roger Gregory <roger>
- Date: Sun, 21 Oct 90 12:10:33 PDT
- Should pseudoconstructors be static member functions? (Shouldn't
we be making more use of static members and member functions?)
No.
Ellis and Stroustrup think pseudoconstructor should be static member
functions of the classes they construct, in contrast to our use of
naked global functions with standardized names. I'm inclined to agree
(as a sytlistic matter, not because of some change in functionality),
and to suggest that the same applies to most functions-about-the-class
that in smalltalk would be messages to the class object.
As it is pseudoconstructors don't have to be declared in the class thet they construct.
Often we have a pseudoconstructor declared with some overlaoading in the class
that defines the parameters for the overloading. This is a good thing. We also
have a pseudoconstructor for an abstract class defined in the concrete class that
actually instantiates it. This is a good thing, why change it.