使用Joda-Time有什么缺点吗? [英] Are there any cons to using Joda-Time?

查看:90
本文介绍了使用Joda-Time有什么缺点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想说服架构经理在我们的产品中加入 Joda-Time jar 。

I want to convince the architecture manager to include the Joda-Time jar in our product.

你知道使用它的任何缺点吗?

Do you know any disadvantages in using it?

我认为Joda-Time需要不断更新因为它包含的文件。这是一个缺点。也许我错了。

I think Joda-Time needs to be constantly updated because of the files that it includes. And that is a disadvantage. Maybe I am wrong.

你能否澄清一下这个问题?

Could you provide some clarity on the subject?

推荐答案

我对Joda Time几乎都有过积极的体验。我的一个问题是在尝试构建我自己的时区时(出于合理的原因,我向你保证:)我有一些非常奇怪的异常,并且文档对于那个特定的用例并不是很好。

I've had almost entirely positive experiences with Joda Time. My one problem was when trying to construct my own time zone (for legitimate reasons, I assure you :) I got some very weird exceptions, and the documentation wasn't very good for that particular use case.

然而,在大多数情况下使用它是一种乐趣 - 不变性使得代码更易于推理,并且格式化程序的线程安全非常有用。

However, for the most part it's been a joy to use - immutability makes code a lot easier to reason about, and thread-safety for formatters is hugely useful.

是的,有些文件要保持最新 - 但至少你可以让它们保持最新状态。这并不是说它们包含了Java内置的东西所不具备的东西,只是使用Java的机制,你只是无法保持时区之类的信息是最新的而没有明显的hackery!

Yes, there are files to keep up to date - but at least you can keep them up to date. It's not like they contain things which were unnecessary with Java's built-in stuff, it's just that with Java's mechanism you just couldn't keep information like timezones up to date without significant hackery!

基本上,+1使用Joda Time。 Java日期/时间API是Java平台中最差的一个,IMO。

Basically, +1 for using Joda Time. The Java date/time API is one of the worst bits of the Java platform, IMO.

这篇关于使用Joda-Time有什么缺点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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