I was thinking that in the future I might be updating some of my class libraries and when I do that, it might be useful to keep old classes, namespaces and objects in the updates just for backwards compatability.

I was wondering what you guys and gals thought of naming classes and namespaces with version information? For example a namespace might be MyCompany.MyApp.ControlLibrary.V1 or MyCompany.MyApp.ControlLibraryV1 or some other variation.

The reason I was thinking about this is, if I needed to update say, a class, and the update was basically a very large re-write (or total re-write) and I wanted to keep the old one there for backwards compatability, the name of the class would already be taken, wouldn't it be better to version everything like that so it would be ControlLibrary.MyTextboxV1 instead of just ControlLibrary.MyTextbox? That way the functionality of the first version isn't lost, and unnecessary code isn't needed in the methods to jump around code depending on the application version?

Thoughts?

Recommended Answers

All 3 Replies

That's what version control software is for. I think Subversion is free (and common, at least by the job postings I see). Just do a search on Version Control Software, should get you lots of results.

Every time some foreign code references your new library, it would need to change all of it's class names (instead of just dropping in a new DLL). If there is any Marshalling back to native code, it could be catastrophic without a full rebuild.

Good point Thines, I knew that, but for some reason didn't think of it.

Also, I'll check out the subversion software and see what it's all about.

Thank you both!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.