什么,在一个实用程序库包括:实用程序

由网友(猫弦)分享简介:通过在我带越来越多的项目中,我发现,我常常重复的项目中许多常见任务的项目,客户端到客户端。所以,我已经开始组建一个实用库中,这往往因项目重复这些通用元素的集合。到目前为止,我有工具来调整图像,数据导出网格到Excel,发送电子邮件,并更换切分的消息。 如果你正在构建/使用.NET工具类库,什么类型的过程,你会看到有帮助...

通过在我带越来越多的项目中,我发现,我常常重复的项目中许多常见任务的项目,客户端到客户端。所以,我已经开始组建一个实用库中,这往往因项目重复这些通用元素的集合。

到目前为止,我有工具来调整图像,数据导出网格到Excel,发送电子邮件,并更换切分的消息。

如果你正在构建/使用.NET工具类库,什么类型的过程,你会看到有帮助?你会想象什么名称空间/组?

更新

我说的是一个实际的类库,分为命名空间来组织常见的元素。

解决方案 我不会写了一个名为通用或工具或杂项或者......你的想法库。相反,我倒是有一个叫库目录下,并有每个功能区的下一个独立的库。例如,我可能有库/跟踪,库/ UI,库/网,库/网页的C ++项目。对于C#,我有库/ Acme.Trace,库/ Acme.Windows.Forms,库/ Acme.Net等(假设你的顶级命名空间/家公司被称为尖端)。 YAGNI。不要去写code,你的可能的需要。 请不要扔东西到一个共享库,直到你已经用他们的两个或两个以上的项目。 你不应该忽略的五个机器学习项目

With more and more projects under my belt I find that I am often repeating many common tasks from project to project, client to client. So I have started to assemble a "utility" library, a collection of these common elements that are often repeated from project to project.

So far I have utilities to resize images, export data grids to excel, send e-mails, and replace tokenized messages.

If you were building/using a .NET utility class library, what types of processes would you see as helpful? What namespaces/groups would you envision?

Update

I am talking about an actual class library, separated into namespaces to group common elements.

解决方案

I wouldn't write a library called 'Common' or 'Utilities' or 'Misc' or... You get the idea. Instead, I'd have a directory called 'Lib', and have each area of functionality in a separate library under that. For example, I might have Lib/Trace, Lib/UI, Lib/Net, Lib/Web for a C++ project. For C#, I'd have Lib/Acme.Trace, Lib/Acme.Windows.Forms, Lib/Acme.Net, etc. (assuming your top-level namespace/company is called 'Acme'). YAGNI. Don't go writing code that you might need. Don't throw things into a shared library until you've used them in two or more projects.

阅读全文

相关推荐

最新文章