Date classes

Philippe Marschall philippe.marschall at gmail.com
Tue Apr 17 13:42:00 UTC 2007


2007/4/17, Hernan Wilkinson <hernan.wilkinson at gmail.com>:
> Just to give you a fast review of what I remember (I developed the model
> that Maxi Taborda converted into Chalten):
> 1) Chronos supports many calendars, Chalten only the Gregorian Calendar
> 2) Chronos supports time zones, Chalten does not

Additionally Chronos also supports nominal time and leap seconds.

> 3) Choros is huge (as you mentions), Chalten is more manageable (because it
> just model the Gregorian Calendar)
> 4) Chronos lacks some abstractions that Chalten has, like Day of Month and
> others (I don't remember now...there are a couple of mails that I and the
> guy that created Chronos wrote about these issues, like one year ago)
> 5) Chalten is based on a arithmetic model that allows you to represent time
> measurements easily (like 3 days, 5 months, etc).

That won't work in Squeak because these methods are already by the
Squeak Chronology (unless you have classboxes). It might work in VW
though.

> These objects are
> polymorphic with numbers respect to the arithmetic messages such as +, -, *,
> etc., that means that you can use them in arithmetic formulas

That's true to a certain extent in Chronos for example you can:
Timepoint now - (CalendarDuration months: 1)
(CalendarDuration months: 1) * 5
but you can't:
5 * (CalendarDuration months: 1)

> 5) And of course, I like Chalten's model more that Chronos :-). For me it is
> easier to use, but this is just a matter of taste...
>
> There is a paper we wrote 2 years ago about the problems that the Smalltalk
> date classes have and the advantages of having a better model. If you are
> interested on having better date and time classes, I recommend you to read
> the paper... you may not like it, but at least you will see other people
> ideas...
> We use that model (Chalten) in a production system and we believe it allowed
> us to avoid many common mistakes related to financial systems.... but hey,
> that's just a feeling, nothing I can prove formally.
>
> I hope you can do something useful.
> Bye,

Chronos is a bit ugly in Squeak because Squeak does not support
namespaces which means that classes that model the same concept as
Squeak Chronology classes have different names (unless you mess with
shared pools). Also loading it is a bit of a pain with Monticello
(this is the fault of Monticello and not Chronos).

Cheers
Philippe

> Hernan.
>
>
> On 4/16/07, J J <azreal1977 at hotmail.com> wrote:
> > I have looked at Cronos but it is really huge, and the classes that come
> > with the image are already very close.  I will have to look at Chalten,
> but
> > what is wrong with a few upgrades to the classes that come with Squeak?
> >
> > >From: "Hernan Wilkinson" <hernan.wilkinson at gmail.com>
> > >Reply-To: The general-purpose Squeak developers
> > >list< squeak-dev at lists.squeakfoundation.org>
> > >To: "The general-purpose Squeak developers
> > >list"<squeak-dev at lists.squeakfoundation.org>
> > >Subject: Re: Date classes
> > >Date: Mon, 16 Apr 2007 14:28:09 -0300
> > >
> > >Before doing something with Date, I recommend you to take a look at
> > >"Chalten" or "Cronos". Chalten is in SqueakSource.... I think Cronos too.
> > >
> > >Hernan.
> > >
> > >On 4/16/07, J J <azreal1977 at hotmail.com> wrote:
> > >>
> > >>Hi all,
> > >>
> > >>I am doing some stuff with dates and I noticed the date classes that
> come
> > >>with the default Squeak image are very nice and very close to having
> > >>everything I would want.  But there are a few inconsistencies here and
> > >>there, and things missing that would make things easier.
> > >>
> > >>So what is the procedure to updating this?  I think it's part of the
> core
> > >>system so I probably can't just do a monicello package update
> > >>somewhere?  Do
> > >>I have to do it through mantis?
> > >>
> > >>Thanks,
> > >>Jason
> > >>
> >
> >>_________________________________________________________________
> > >>Download Messenger. Join the i'm Initiative. Help make a difference
> today.
> >
> >>http://im.live.com/messenger/im/home/?source=TAGHM_APR07
> > >>
> > >>
> > >>
> >
> >
> > >
> >
> >
> _________________________________________________________________
> > Get a FREE Web site, company branded e-mail and more from Microsoft Office
> > Live!
> http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
> >
> >
> >
>
>
>
>
>



More information about the Squeak-dev mailing list