[GemStone-Smalltalk] migrating to SmallDate and SmallDateAndTime

Wai Lun Mang mang at acm.org
Thu Sep 1 17:37:59 PDT 2022


 A way to do this is to find all the instances of Date using the allInstances method and iterated it.  Create the corresponding SmallDateAndTime and use become: to swap the pointers.  Once you have all the instances (store them in some global), you can use multi gem sessions to perform the migration assuming you have a lot of them.  
One thing to be careful is that gemstone system objects might have Date instances, it is safe to migrate them?
    On Thursday, September 1, 2022 at 09:51:46 AM PDT, Richard Sargent via GemStone-Smalltalk <gemstone-smalltalk at lists.gemtalksystems.com> wrote:  
 
 Sorry, Otto. #copy will NOT do it. I misread my results.
I suggest you create an e.g. #normalized method on the various original classes and on their Small* subclasses and on Object. Object and the Small* classes would answer self. The implementation on DateAndTime, etc.would use the instance creation API to create a new instance (which would turn out to be the special OOP encoded object). Replace the instance if #normalized gives you a different object, leave it alone if it answers the original object.


On Thu, Sep 1, 2022 at 9:32 AM Otto Behrens <otto at finworks.biz> wrote:

Ha! Thanks a lot Richard
On Thu, 01 Sep 2022, 18:23 Richard Sargent, <richard.sargent at gemtalksystems.com> wrote:

On Thu, Sep 1, 2022 at 5:18 AM Otto Behrens via GemStone-Smalltalk <gemstone-smalltalk at lists.gemtalksystems.com> wrote:

Hi,
We are upgrading to GS 3.6.x and would like to convert our Date objects to SmallDate and DateAndTime objects to SmallDateAndTime. What would be an efficient way to do this? I reckon I will have to hunt for the most commonly used places where they are used and then just convert.

Repository>>allReferencesToInstancesOfClasses: can be used to find the referencing objects. 
 


What would be the best methods to use to create a new SmallDate from a Date and a SmallDateAndTime from a DateAndTime?

Sending #copy to the old DateAndTime should answer a SmallDateAndTime.  



Thanks

| 
Otto Behrens


+27 82 809 2375
 |  |


|  |


|  |


|  |


|  | www.finworks.biz |


|  |


| 
Disclaimer & Confidentiality Note: This email is intended solely for the use of the individual or entity named above as it may contain information that is confidential and privileged. If you are not the intended recipient, be advised that any dissemination, distribution or copying of this email is strictly prohibited. FINWorks cannot be held liable by any person other than the addressee in respect of any opinions, conclusions, advice or other information contained in this email.
 |

_______________________________________________
GemStone-Smalltalk mailing list
GemStone-Smalltalk at lists.gemtalksystems.com
https://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk



_______________________________________________
GemStone-Smalltalk mailing list
GemStone-Smalltalk at lists.gemtalksystems.com
https://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/archives/gemstone-smalltalk/attachments/20220902/37cb2b53/attachment.htm>


More information about the GemStone-Smalltalk mailing list