From: Tony Arcieri Date: 2010-03-16T02:07:14+09:00 Subject: Re: Overriding new? --000e0cdf1c207c73320481d9e9c8 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Mar 15, 2010 at 7:41 AM, Andrea Dallera wrote: > Hei Chuck, > > that's exactly what i was trying to avoid. One way to avoid it is to override new. You can use the "allocate" method to create a new object instance without invoking its constructor. Name the superclass's "initialize" method something different, like preinitialize, and invoke that yourself. Be sure to invoke initialize too, if it's defined. I've used this approach in frameworks where I intend for users to subclass, but my general impression nowadays is I should use a lot cleaner base class that doesn't need these sorts of hax, or not expect users to ever define their own constructor. -- Tony Arcieri Medioh! A Kudelski Brand --000e0cdf1c207c73320481d9e9c8--