Passing "this" to a constructor, bad form?
Posted on 2003-03-20
I just starting working for a new company after a 9 month period of twidling my thumbs. They have a poorly created class hierarchy. I'm trying to clean it up but each class uses so much crap from every other class it's difficult. One type of class in particular is xxxCmdThread. There are about 20 seperate class file with different names that use identical code, I'm trying to collapse them into one. The problem is that each one references pieces of it's creator directly. These CmdThread classes really only handle shutdowns and do some logging (using the creators log reference). The CmdThread also changes the member var shutdown flag to true and then reads it's JavaSpace. Would it be bad form to just pass "this" to the CmdThread and let it invoke these directly or should I look to find another way?