开发者

Namespace and Assembly names for a reusable component

I've got a bit of a conundrum on my hands.

开发者_StackOverflow中文版

I'm currently compiling a load of 'code snippets' into reusable libraries that I obviously intend to use in multiple applications.

I'm having trouble deciding on an appropriate namespace and assembly name.

Basically, I've currently got JasonSummers.Validation as an example for my validation library, since I have no 'company' and no specific project which the code applies to.

However, later on, when I come to use said namespace in a client's project, I don't think it's really appropriate to have my name referenced in code which they will probably own the IPR for.

I would just use 'Validation' as the namespace (after all, StructureMap is StructureMap, not JeremyMiller.StructureMap) but this may cause confusion for future developers as 'Validation' is used in the 'System' set of namespaces provided by .net

All comments greatly appreciated.


You can always use name from biology e.g Tribulus. or any other for your root namespace. So your code goes into e.g Tribulus.Validation or Tribulus.Utilities etc. Toplevel namespace need not to be a functional name. It can be just a signature of a company or just a unique interesting name as i mention.


In my personal experience, I maintain a code base for that useful functions at source level, i.e., I copy every function I need in every project, under my client brand and assembly name.

I didn't found be useful to keep that functions at assembly level, exactly because that: it'll contain some names which can generate confusion and for an extra reason: a client paid for some functionality, but not for another (include in a general assembly). So, I just pack what he/she bought.

An option could be to use a neutral name, like Reusable and to merge your utility assembly by using ilmerge framework command.


Take a look at Microsoft's Namespace Naming Guidelines

I got it as an answer from Konamiman to my question which is related to yours.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜