namespaces when reusing source code

  • Thread starter Thread starter Andy Fish
  • Start date Start date
A

Andy Fish

Hi,

With languages like c# having namespaces, I was wondering what's the
recommended practice for reusing source code. I'm not talking big stuff like
log4net that's version controlled and usually distributed as binaries, just
packages of a few classes.

a typical small component will be distributed as open source with a
copyright statement and will usually include a project file and use a
namespace of the author's own choosing. however, it is quite possible I
might need to dink the code in some way for my application

should I include it all into my source tree and replace the namespaces with
my own (but obviously leave the copyright statements intact)? or should I
keep the separate project and distribute (yet) another DLL with my
application?

Andy
 
You are not required to have exactly one namespace in one DLL. You can have
a class a.a.a referencing b.b.b and both beeing compiled into the same DLL.

Just leave the namespace, even the file, as is ;)

Markus
 
Hi Andy,

sorry I missunderstood your question.

I would recommend you to make least changes to the source code. If you want
to use the component from several of your applications put it into a
seperate library, otherwise compile it into your application.

Leaving the code unchanged makes it possible to replace it more easily.

Please keep in mind the Opensource license terms, too. Normally you must
send your changes back to where your component came from.

Markus
 
Back
Top