如何处理功能去precation库? [英] How to handle functions deprecation in library?

查看:132
本文介绍了如何处理功能去precation库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Java库,并想从中删除一些功能。我这种情况的原因是公共的API和设计的清理。某些对象制定者,而应该是一成不变的,一些功能已经在不同的方法来实现更好/更清洁,等等。

I'm working on a Java library and would like to remove some functions from it. My reasons for this is public API and design cleanup. Some objects have setters, but should be immutable, some functionality has been implemented better/cleaner in different methods, etc.

我标志着这些方法去precated,并希望最终将其删除。目前,我正在考虑几个冲刺(2周开发周期)后,删除这些。

I have marked these methods 'deprecated', and would like to remove them eventually. At the moment I'm thinking about removing these after few sprints (two week development cycles).

是否有关于删除冗余的公共code的最佳实践?

Are there any 'best practices' about removing redundant public code?

/ JaanusSiim

/JaanusSiim

推荐答案

设定一个日期,并在德@ precated标签宣传。给予拆除的时间长短取决于用户数量的code的,连如何你与他们的变化的原因。

Set a date and publicize it in the @deprecated tag. The amount of time given to the removal depends on the amount of users your code has, how well connected you are with them and the the reason for the change.

如果你有成千上万的用户,你几乎与他们交谈,时间框架也许应该在几十年的范围: - )

If you have thousands of users and you barely talk to them, the time frame should probably be in the decades range :-)

如果你的用户是你的同事10,你每天看到他们,时限可以很容易地在接下来的几周范围内。

If your users are your 10 coworkers and you see them daily, the time frame can easily be in the weeks range.

/**
 * @deprecated
 * This method will be removed after Halloween!
 * @see #newLocationForFunctionality
 */

这篇关于如何处理功能去precation库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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