From: Mikkel Bruun Date: 2001-12-07T05:27:42+09:00 Subject: [ruby-talk:27742] Re: Package Naming well....there's pros and cons.... using import statements enables you to just look one place when doing massive changes... Two classes with the same name doesnt makes sense in a purely theoritically point of view, but as you point out, this can occur when using 3rd parties... Style...is just style...not the holy bible... I just think we need to address this package situation quickly, and the java way works...it isnt perfect, but it works... regards Mikkel ----- Original Message ----- From: "Dan Hable" To: "ruby-talk ML" Sent: Thursday, December 06, 2001 9:21 PM Subject: [ruby-talk:27740] Re: Package Naming > I would have to disagree. If I only need the name at a sngle point inside the entire class, it doesn't make sense to bring that name into my current namespace. This can lead to more code changes in the future if someone else decides to bring in another class with the same name but from a different vendor. > > Dan > > >>> mikkel@increment.dk 12/06/01 02:06PM >>> > well...thats known as bad coding style (unless the opposite will introduce > nameclashes).... > > Mikkel > > ----- Original Message ----- > From: "Dan Hable" > To: "ruby-talk ML" > Sent: Thursday, December 06, 2001 8:55 PM > Subject: [ruby-talk:27736] Re: Package Naming > > > > What if someone decided to explicitly reference the class every time they > used it? > > > > >>> billk@cts.com 12/06/01 12:28PM >>> > > > > From: "Rich Kilmer" > > > > > > 3) Name your packages after your company domain and product (like > > > sun told us to) > > > > > 5) Change the name of the company (and domain) (major refactor) > > > > > 6) The library is finally updated to use the standard convention of > > > "com.domain.libraryname.classname" (major refactor) > > > > Just curious, wouldn't a one-liner such as > > > > find . -name "*.java" -exec ruby -i -pe > 'gsub(/(import\s+com)\.foo/,"\1.bar")' {} \; > > > > to change all "import com.foo..." to "import com.bar..." pretty > > much handle all of the package renaming? (Or am I missing some > > aspect of it?) > > > > (OK whoops I forgot about the 'package' declarations, but we > > should be able to change the gsub to > > > > gsub(/((?:import|package)\s+com)\.foo/,"\1.bar") > > > > and still keep our one-liner :-) > > > > > > Regards, > > > > Bill > > > > > > > > > > > > > >