namespaces when reusing source code

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
 
M

Markus Kling

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
 
M

Markus Kling

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top