views:

507

answers:

10

We plan on changing our company name starting October 1st. All of our namespaces, projects etc use XYZ.ComponentName.

My question to you would be, on October 1st, what would you do? Change all the old components to ABC.ComponentName? Leave the old ones but any new development becomes ABC.ComponentName? Just stick with the old name?

+1  A: 

Mixing and matching namespaces is often very troublesome and confusing from a maintenance standpoint. I would say that it really depends on the number of components you're dealing with and how many applications are dependent on them.

Perhaps it would make sense to map out the dependencies and get a feel for how much work you've got on your hands.

jmarnold
+13  A: 

It Depends.

Some things to consider: If changing the namespace means moving files in CVS, then there is a penalty because you lose the history. If changing the namespace means manual work, you're going to miss places and cause bugs.

Also, do you have external users of the code/libraries? If they have to change their code because you've renamed the company, they will be annoyed.

I'd be inclined to leave the code the way it is. Namespaces are meaningless except to prevent collisions; at this point it's only marketing. But for new products I'd for sure use a new namesapce.

Where I used to work we had a few company-name or app-name changes and it was always problematic. One application was delayed by a couple weeks while they ironed out the bugs from a global namespace change at the last minute. Another application never adopted the new names and was always internally referred-to by the obsolete name, potentially confusing for new users. Imagine if everything in Java was still called 'Oak'.

Mr. Shiny and New
FYI: If you use Perforce for version control, you don't lose that history. It tracks a file's history even across branches (a rename actually consists of a branch and delete operations). They added that very helpful functionality within the last year or two.
raven
@Raven .. strike one also for VSS - for a change .. lol
Peter M
@raven: Yeah, CVS is the worst offender about tracking file revisions across renames. But it's very common still. We're stuck with it at my work for now... sigh.
Mr. Shiny and New
For example, so many classes in Cocoa framework (Mac) still starts with NS, because they were originally written in NextStep!
Hemant
A: 

That depends on if the components are stable, much used, if it doesn't to to much time to change, if there is time money and developers to change it...

Lots of if's.

rdkleine
A: 

I would probably just leave them as is. Changing them creates a nightmare in work, testing, and verification, and if somebody externally uses your library they also have to change their bindings to accommodate this change.

When Next was bought by Apple, they left the NS prefix as is, you can see this today with Apple's development frameworks. It won't kill you to leave them as is.

For new Namespaces you could change it to ABC but then you would break consistency, which could confuse people - especially new developers.

Just leave it as is and worry about other things :)

Alex Moore
A: 

Also, watch out if you're doing any sort of dependency injection that uses reflection as that can then break.

Another problem is 3rd party code or other projects that use your project if there are any, as changing the namespace would break them.

The safest option is to leave the namespaces as they are.

KeeperOfTheSoul
+2  A: 

Whichever choice you make, don't mix the two namespaces on new development. Be consistent. If you choose to stick with the old one, new development should use that too. If you move to a new one, move everything.

It may require some more analysis of the work involved with your particular scenario to decide if its worth it to switch or not.

Justin Standard
We mix our namespaces ... it causes absolutely no problems. It is a great way to distinguish legacy architectures from newer architectures :)
Precipitous
+1 for Precip, only because it points out a benefit of doing that. As I mentioned below, I think you shouldn't be using namespaces for this in the first place, and this situation shows why.
T.E.D.
+4  A: 

Are you selling those components to 3rd parties? If not, then it's not worth the effort. If you are, then the namespace is part of your marketing and therefore should be changed.

TomA
A: 

It has been my experience in scenarios like this, that it is best to leave the namespace as it currently is. Any new libraries developed can use the new company name in the namespace.

Mr. Will
+3  A: 

As for the current pickle you find yourself in, I would ask for some $$ from the signage changing budget for fixing the code. If they don't give it to you, leave the old name be.

I think the proper answer is that you don't create namespaces with your company name in them in the first place. Pretty much everyone there knows who signs their paychecks; you alliviate no confusion by enshrining the name in code.

I had one coworker who discovered namespaces one day, and next thing I knew our entire software library has to be accessed through several layers of namespaces designating our company, division, and project. The thing is, we only really have the one project (although you could convince me of the benifit of that), the other divisions don't do software, and code we take from other companies doesn't follow his scheme. So really its just a lot of useless extra typing we have to do. Yes, we can do "using", but then there's no real benifit to the namespaces at all. Oh, and of course our division name changed a couple years later, when management decided "division" sounded to devisive, and we should now be called "teams". %-(

Namespaces are really best used whenever you have several classes which you would be tempted to name startimg with (or including somewhere) the same string. They aren't for mirroring your software development group's current management reporting structure.

T.E.D.
Well, not using the company name is one way to approach things, but sometimes isn't industry standard: Java's package naming guidelines specifically ask you to name your packages after your TLD. So the SO class which is responsible for parsing comments would have a name like com.stackoverflow.commenting.CommentHTMLParser.
Mr. Shiny and New
I read that in their guidlines back in the late 90's when they first came up with Java. I think their vision was that the web would be chock full of packages that people could share (or buy), and thus something like this would be needed. I'm not a Java guy these days, but it didn't exactly work out that way, did it?
T.E.D.
A: 

why we need chaging the company name? it is benefit for us to change the company name??

Appel pink