Re: Possible bug in Calendar



Harold Yarmouth wrote:
Arne Vajhøj wrote:
Harold Yarmouth wrote:
Arne Vajhøj wrote:
Harold Yarmouth wrote:
It is. And it belongs in the UI layer. Times should be something simple, like nanoseconds since the epoch, under the hood.

Which it also is in Java - the Date class.

But Java need something to match that with calendars - and it has.

There's a problem with this, though -- those deprecated Date constructors. How is someone supposed to get a Date from, say, numbers extracted from a time stamp in some text file in a natural way? Calendar.getInstance(), set(yy, mm, dd, h, m, s), getTime() runs into the problem that started this whole mess, and involves Calendar. Where is the simple, easy to use DateBuilder that does not have these problems?

Calendar.

Excessively complicated to use for the stated purpose. A boondoggle, really.

And why are you so dead set against the idea that adding one would be a good idea?

I am not. We already have it. Calendar.

Excessively complicated to use for the stated purpose. A boondoggle, really.

Almost everybody except you seems capable of using it.

And I really don't think Java API should be designed after
people like you that don't read the docs.

Oh - and it is not just PL - it is also BLL.

No. See an earlier post.

Of course it is.

No. See several fresh posts by me.

Almost all business has things that happen at a certain weekday, at
a certain day in month etc..

Policy object. Dependency injection. Need I repeat myself yet again?

The class still need to be there. It is irrelevant how it gets
instantiated.

Arne
.



Relevant Pages

  • Re: Newbie question - Date Calculation
    ... While it too provides an assortment of 'Calendar' objects and all the ... other necssary accoutrements as seen in java, ... make the language more accessible to newcomers and folks implementing ... though for the aforementioned simplicity / learning curve issues. ...
    (comp.lang.java.programmer)
  • Re: Possible bug in Calendar
    ... It may be a concern of application user-interface design, but that's a whole different kettle of fish. ... Imagine if it were otherwise -- Calendar would not accept dates before 4004 BC, to avoid offending Christians, or after 2012, to avoid offending Mayans. ... Programs written in Java would refuse to work on Sundays. ... Java need to support multiple calendars to support people that ...
    (comp.lang.java.programmer)
  • Re: custom class in java.* package - is it possible?
    ... (Actually all treads using Calendar have to stop when any other thread ... You probably missed the info that we use *MS* Java ... > platform classes is very simple: ... I wouldn't do it if it was Sun Java, as Sun Java Calendar class has ...
    (comp.lang.java.programmer)
  • Re: Newbie question - Date Calculation
    ... > While it too provides an assortment of 'Calendar' objects and all the ... > make the language more accessible to newcomers and folks implementing ... > though for the aforementioned simplicity / learning curve issues. ... It's not Java that's complicated, ...
    (comp.lang.java.programmer)
  • Re: Uhrzeit auslesen, Minuten addieren
    ... Calendar aktuelleZeit = Calendar.getInstance; ... Das schreibt dir doch Java ... public Date berechneETAnp(double dSN) { ...
    (de.comp.lang.java)