[Seaside] [VW] Seaside/VW Support - Time & Date Classes

Brett Taylor brett.taylor at healthauditors.com
Sat Feb 12 18:44:39 CET 2005


Michel,
I thought you were playing these types of tricks;)  In fact, I prefer the Squeak Chronos classes to the VW Date, Time and Timestamp classes.  I would prefer that Glorp for portability purposes and better business support utilized the Squeak chronology library.  I've implemented some of the support for the Squeak timespan classes in VW Glorp and at some point will complete that task.  My main issue with the multiple classes is that I need to make the extra step each time when saving code that uses one of these classes to quailify which of the 3 Date classes I want to use.  Maybe there is something I can do to make this easier.  Any suggestions?
Brett

On Sat, 12 Feb 2005 10:43:44 +0100, Michel Bany <m.bany at wanadoo.fr> wrote:

>
>> Michel,
>> I was wondering if there is a reason that there are two Date and Time
>> classes in the VW port?  As far as I can tell, there is no additional
>> behavior.  The classes are Squeak.Date, Seaside.Date and Squeak.Time &
>> Seaside.Time.  It seems this also applies to the class Color.
>>
> Yes Brett, there is a reason. Here are the details, sorry for being long.
>
> A large amount of the port work consists in making VisualWorks look like
> Squeak for Seaside.
> For this purpose, we need to add conveniency methods to the base
> VisualWorks library
> and also a bunch of new classes to implement some of the Squeak API. At
> some point in time
> I got the idea to extract all of the "squeakisation" stuff and to create
> a separate bundle. So I created
> that bundle named "Squeak" where I collected the squeakisation items
> needed for Seaside and,
> while at it, I collected more squeakisation stuff from other sources. At
> the same time, I was having
> problems porting the cookies expiration logic, because Seaside relies on
> the Squeak Chronology
> framework for this. Also at the same time, there were discussions (on
> the VWNC mailing list I believe)
> regarding the availability of class DateAndTime in VisualWorks. So I
> decided to port the Chronology
> classes to VisualWorks and I created bundle "Squeak-Chronos". Bundles
> "Squeak" and "Squeak-Chronos"
> were designed independently of Seaside.
>
> As can be expected bundle "Squeak-Chronos" has some classes that
> conflict with the base VisualWorks
> library, namely, Date, Time, and TimeZone (TimeStamp in Squeak does not
> conflict with Timestamp).
> Fortunately VisualWorks has namespaces that can handle that.
>
> However, the Seaside namespace imports both the Squeak and the Smalltalk
> namespace, therefore
> references to these three class names are ambiguous. Since I did not
> want to patch the Seaside
> source code to replace all occurences of those ambiguous names by fully
> qualified names, I used
> a naughty trick to define classes Date, Time and TimeZone in the Seaside
> namespace as subclasses
> of Date, Time, TimeZone from the Squeak namespace, just to resolve the
> ambiguity transparently
> for Seaside. This also ensures that Seaside uses the Squeak
> implementation of these three classes
> making the Seaside port easier and quicker, since I do not have to care
> about Date and Time
> differences between Squeak and VW.
>
> For the Color class, I used the same naughty trick, in a different
> context. Seaside contains extensions
> to the Color class. However the Color class does not exist in
> VisualWorks but exists in the "Squeak"
> bundle, defined in the Squeak namespace as a subclass of VW ColorValue.
> When importing the
> Seaside code into VisualWorks, the Color extensions (for some reason)
> could not be assigned to
> Squeak.Color, therefore I created Seaside.Color (subclass of
> Squeak.Color) so that Seaside
> extensions to Color could be loaded. Note that Seaside does not use the
> Color any longer since
> the Seaside-Contrib package was discontinued.
>
> A final note.  You may want to try if Seaside would work with the Date
> and Time from the base
> VisualWorks library. Just change the superclass of Seaside.Date and
> Seaside.Time to be Core.Date
> and Core.Time and see how it goes.
>
> Enjoy,
> Michel.
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
>




More information about the Seaside mailing list