如何确保代码重新正确使用? [英] How do you ensure code is reused correctly?

查看:155
本文介绍了如何确保代码重新正确使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在应用程序中引入新功能时,我们可能会生成工件,例如可用于我们应用程序其他区域的有用方法或类。这些工件不一定被记录为功能需求,因为它们通常是我们的实现选择的副作用。由于我们经常开发团队,因此重要的是分享这些代码以防止返工和重复。



示例:




  • 实用方法和课程

  • 基础类

  • 界面

  • GUI控件



您发现什么是分享这些工件的最有效方法?



您如何传达创建时所做的假设?



如何确保消费正确?



我对文档的最佳实践和成熟的技术感兴趣,代码图,会议(?),以确保代码重新正确使用。



这个问题非常类似于:

解决方案

解决方案

我们的团队在开发过程中使用了大量有用的图书馆。这些库以开放源代码的方式保存在一个通用的存储库中。有一个人监督每个图书馆(或多个图书馆),开发人员可以提交修补程序。



然后,这些库被释放/构建到一个共同的位置(我们部署到网络服务器),然后人们可以下载它们,并在任何他们想要的项目中使用它们。到目前为止,它已经很好了。我们唯一需要注意的是,如果有API更改,我们必须确保我们确保每个人都意识到这一点。我们通过版本号和通过我们的图书馆wiki的信息来做到这一点。



编辑另外,我们还会为我们的库发布生成的文档( Javadoc,Crystal Report,任何),以便开发人员可以利用这些。


Frequently when we introduce a new feature into an application we may produce artifacts, such as useful methods or classes that could be reused in other areas of our applications. These artifacts are not necessarily documented as functional requirements as they are usually a side-effect of our implementation choices. Since we often develop in teams, it is important to share these pieces of code to prevent rework and duplication.

Examples:

  • Utility methods and classes
  • A Base class
  • An Interface
  • A GUI control

What have you found to be the most effective way of sharing these artifacts?

How do you convey the assumptions you made when you created them?

How do you ensure they are consumed correctly?

I am interested in best practices and proven techniques around documentation, code diagrams, meetings(?) to ensure code is reused correctly.

This question is very similar to: Finding Reusable code but I'm interested in a more proactive than reactive approach.

解决方案

Our team has a number of helpful libraries that we use throughout our development. These libraries are kept in a common repository in sort of an "open-source" methodology. There is one person who oversees each library (or multiple libraries) and developers can submit patches.

The libraries are then released/built to a common location (we deploy to a web server) where people can then download them and use them in whatever project they would like. So far, it has worked pretty well. The only thing we have to watch out for is, if there is an API change, we must make sure we make sure everybody realizes this. We do this through version numbers and through information on our library wiki.

Edit: In addition, we publish the generated docs for our libraries (Javadoc, Crystal Report, whatever) so that developers can utilize those.

这篇关于如何确保代码重新正确使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆