• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Query about date

 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Couldn't we design our dates in java like .NET. In .NET we have only one date class System.Date. It deals all over in the app, with the DB, etc.

So, why cant we design Java API like that. I have gone through util.Date, sql.Date, sql.Timestamp, thoroughly. I know the differences and similarites. And I know how and where they should be used. But couldn't we make it simple like .NET? Like we can deprecate util.Date and move sql.Date and sql.Timestamp in util package and make some alteration in both the classes in order to use them everywhere.

It may sound irrational to you folks.
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you create your own Date class?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stephen Huey:
Why don't you create your own Date class?



Its not about that. However, I am always free to make one.
Thanks for your input.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually I haven't written a dot of .NET but me and my friend was discussing about these Date classes. He said, "In java its very complex. Because we have to use util.Date for calculation stuff and then we have to convert it into sql.Date while storing that date into DB. Although, in .NET we have only one Date class to use anywhere". I supported my love, java, by answering that there must be some good reasons of doing that and i have convinced him a bit, by telling him the differences and details of both the classes, but couldn't find the answer of above question. The question in the original post is not from my friend its from me.

[edited]
Waiting for more inputs.

Thanks.
[ August 17, 2005: Message edited by: Adeel Ansari ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could we move this thread to JDBC forum, as its about sql.Date and DB persistance? I think, there I would get some more inputs.

What you bartenders/sheriffs think?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anybody home?
Is it completely irrational or somethin??
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Breaking not just binary, but source compatibility, like you are suggesting, is a big deal. While it is conceivable that at some point in time there will a version of the JDK that corrects some of the class libraries' idiosyncratic behavior, I see no such thing on the horizon. So unless you're interested in a largely academic debate, there's little point discussing it.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmmm.
Thanks Ulf Dittmer for your input.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic