From: Robert Klemme Date: 2007-10-01T23:08:19+09:00 Subject: Re: Subclassing Thread? 2007/9/30, Stephen Ware : > Kero wrote: > > The usual question is, why would you want that? > > A Thread, by its nature, is something that should be running. > > Especially delaying the start means... there's no underlying thread yet! > > My motivation for wanting the thread in a separate class is simply > convenience. The class will be very large... several pages of code at > least... so putting it into a block would be a little unwieldy. Personally I always found the Java way to inherit java.lang.Thread inferior to using Runnable because the latter is much more flexible. So from my point of view you are asking for the worse alternative. :-) Btw, if your class is multiple screen pages this *may* be an indication that you should do some refactoring and distribute functionality across multiple classes. > Thanks very much for your suggestions. I've found another method that > seems to work well also. Rather than subclassing Thread, I have written > the class (call it "User") as a normal class and done this: > > Thread.new(args){|args| User.new(args)} > > That seems to accomplish what I'm going for. That's also what I'd do. Kind regards robert