You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Sanjaya Karunasena <sa...@yahoo.com> on 2008/07/08 10:47:50 UTC

Representing a Birthday in a distributed scenario

Hi All,

Usually to represent some thing like a Birthday java Date class is used. However, it internally make use of a Calendar instance in most of the operations.
This means unless we send timezone information in a Web Service request with the birthday, there is a time window, when the client and the server is in two different timezones, the day get represented inaccurately.

I came across this library (http://joda-time.sourceforge.net) which doesn't suffer from such design flaws. (http://joda-time.sourceforge.net/key_partial.html)

Thoughts? Probably we need to fix ADB to handle this.

/Sanjaya


      

Re: Representing a Birthday in a distributed scenario

Posted by Eran Chinthaka <er...@gmail.com>.
Hi Sanjaya,

I agree with your point here. Also as you might already know, one of the
best known ways to represent times within a distributed system is to use an
implementation of Lamport clocks. Also these distributed clocks are really
useful when the system has large number of nodes.

But my question is no one had ever complained about these time problems. And
also if we can do this using timezone information (which I am yet to find
out), why bother introduce new libraries in to that?
We can find loads of things build around, java foundation classes, which
claims to improve basic java functionality. If the current thing is working,
99% of the time why bother worrying about it.

I can still remember what Sanjiva and Glen wrote on the white board during
the last day of first Axis2 summit. We always should KISS and adhere to
YAGNI, which I liked a lot.

Please note that, I appreciate your suggestion and understand what your
point is. But making it a first class citizen by putting those in to ADB,
hmm ... I don't think I will agree to that.

On Tue, Jul 8, 2008 at 1:47 AM, Sanjaya Karunasena <sa...@yahoo.com>
wrote:

> Hi All,
>
> Usually to represent some thing like a Birthday java Date class is used.
> However, it internally make use of a Calendar instance in most of the
> operations.
> This means unless we send timezone information in a Web Service request
> with the birthday, there is a time window, when the client and the server is
> in two different timezones, the day get represented inaccurately.
>
> I came across this library (http://joda-time.sourceforge.net) which
> doesn't suffer from such design flaws. (
> http://joda-time.sourceforge.net/key_partial.html)
>
> Thoughts? Probably we need to fix ADB to handle this.
>
> /Sanjaya
>
>
>


-- 
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada