• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!



Page history last edited by PBworks 16 years, 2 months ago

Unload traits


Phase 1: Disable traits activity and stub out the instance variables that will be removed in Phase 2

SystemChangeNotifier uniqueInstance

noMoreNotificationsFor: ProvidedSelectors current;

noMoreNotificationsFor: RequiredSelectors current;

noMoreNotificationsFor: LocalSends current.

Installer installUrl: 'http://installer.pbwiki.org/f/UnloadTraits-StubOutAcessors.cs'.


Phase 2: Recompile the image with classes in the old format, ie, without the traitsComposition and localSends instance variables


ClassDescription subclass: #Metaclass

instanceVariableNames: 'thisClass'

classVariableNames: ' '

poolDictionaries: ' '

category: 'Kernel-Classes'.

ClassDescription subclass: #Class

instanceVariableNames: 'subclasses name classPool sharedPools environment category'

classVariableNames: ' '

poolDictionaries: ' '

category: 'Kernel-Classes'.

] on: Warning do: [:warning | warning resume].


Phase 3: Remove all traits and all references to the Traits classes from the image, including methods that refer to traits functionality

"Kill all traits" "variables are nil-ed out to prevent obsolete refs later"

Smalltalk allTraits do: [:trait | trait removeFromSystem. trait := nil].

"Recompile all methods that were part of a trait"

SystemNavigation default allBehaviorsDo: [:class | class selectorsAndMethodsDo: [:sel :method | class ~~ method methodClass ifTrue: [class recompile: sel]. method := nil]. class := nil].

"Remove references to traits from various places in the code"

Installer installUrl: 'http://installer.pbwiki.org/f/UnloadTraits-ClearRefs.cs'.


Phase 4: Unload the Traits package and install the Traits compatability stubs for Monticello

Installer unload: 'Traits'.

Installer installUrl: 'http://installer.pbwiki.org/f/TraitsStubs.cs'.

Comments (0)

You don't have permission to comment on this page.