I have the situation that I want to replace a top-level namespace with
another. I have saved objects in BOSS or a parcel, and those objects are instances of classes in the namespace, say, Sepher.LogSim. Now I want to load those objects in a system that has the the same domain object classes, but now in namespace Reflektis.LogSim. Is there a way to substitute namespaces? I looked into NameSpaceSearchRules but I could not find a valid strategy. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Maybe it's helpful to check out contributed\Heeg\GHBOSSCompatibility.pcl ?
It solves the (easier) problem to read BOSS files written with VisualWorks versions prior to 5i4, which means that there is no namespace information for classes to be imported. Having a look at it will give you an idea or memory update about the patterns involved. Loading parcels is quite a different thing because the CodeReader does not use BOSS, and I cannot easily spot the methods that are responsible for namespace resolution. If you need a super efficient way to load your migrated parcels just as usual, you need to dig through it yourself. But if you just want to load those parcels somehow and if going back to file-in is acceptable, then I can offer again a Heeg contribution that was of great help in our migration projects: GHChangeList from contributed\Heeg\GHTools.pcl. The GHChangeList is a modified Change List which allows to define substitutions that are applied on the fly while replaying (filing in). You could define substitutions that map namespace with a different target namespace. Best Regards Holger Guhl Am 11.04.2012 09:26, schrieb Rob Vens: > I have the situation that I want to replace a top-level namespace with > another. > I have saved objects in BOSS or a parcel, and those objects are > instances of classes in the namespace, say, Sepher.LogSim. > Now I want to load those objects in a system that has the the same > domain object classes, but now in namespace Reflektis.LogSim. > Is there a way to substitute namespaces? I looked into > NameSpaceSearchRules but I could not find a valid strategy. > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Rob Vens-3
I haven't tried this, but you could try to recreate your old namespace
as a namespace full of aliases. It will contain only shared vars, each named as an old class and initialized to contain a reference to the new class. R - On 4/11/2012 9:26 AM, Rob Vens wrote: > I have the situation that I want to replace a top-level namespace with > another. > I have saved objects in BOSS or a parcel, and those objects are > instances of classes in the namespace, say, Sepher.LogSim. > Now I want to load those objects in a system that has the the same > domain object classes, but now in namespace Reflektis.LogSim. > Is there a way to substitute namespaces? I looked into > NameSpaceSearchRules but I could not find a valid strategy. > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Holger Guhl
I will look at those tools, I should have remembered them, because I
have used them successfully in the past. However, note that my files are not code files, but *objects*. So I have an object of class Sepher.Currency which needs somehow to be created/migrated to be an instance of Reflektis.Currency. Putting a hook into an exception does not work, because I do not get a proper entry into a debugger (doesNotUnderstand: kicks in, and the problem is not on the call stack anymore). Anyway, maybe the Heeg tools contain some usable code, I will report back. Op 11-04-12 10:22, Holger Guhl schreef: > Maybe it's helpful to check out > contributed\Heeg\GHBOSSCompatibility.pcl ? > It solves the (easier) problem to read BOSS files written with > VisualWorks versions prior to 5i4, which means that there is no > namespace information for classes to be imported. Having a look at it > will give you an idea or memory update about the patterns involved. > Loading parcels is quite a different thing because the CodeReader does > not use BOSS, and I cannot easily spot the methods that are > responsible for namespace resolution. If you need a super efficient > way to load your migrated parcels just as usual, you need to dig > through it yourself. > But if you just want to load those parcels somehow and if going back > to file-in is acceptable, then I can offer again a Heeg contribution > that was of great help in our migration projects: GHChangeList from > contributed\Heeg\GHTools.pcl. The GHChangeList is a modified Change > List which allows to define substitutions that are applied on the fly > while replaying (filing in). You could define substitutions that map > namespace with a different target namespace. > > Best Regards > Holger Guhl > > Am 11.04.2012 09:26, schrieb Rob Vens: >> I have the situation that I want to replace a top-level namespace with >> another. >> I have saved objects in BOSS or a parcel, and those objects are >> instances of classes in the namespace, say, Sepher.LogSim. >> Now I want to load those objects in a system that has the the same >> domain object classes, but now in namespace Reflektis.LogSim. >> Is there a way to substitute namespaces? I looked into >> NameSpaceSearchRules but I could not find a valid strategy. >> >> _______________________________________________ >> vwnc mailing list >> [hidden email] >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Reinout Heeck-2
Works magically! But for one small issue: all namespaces below my top
level name space can thus be mapped nicely. But not so for the top level namespace. If you have any objects in your top-level namespace you need to define the mapping in the Smalltalk namespace. This involves only one binding: your top-level namespace: Smalltalk defineSharedVariable: #Sepher private: false constant: false category: 'Reflektis-Sepher' initializer: '"Mapping for Sepher namespace to the new Reflektis namespace." Reflektis' So: issue solved! Op 11-04-12 12:59, Reinout Heeck schreef: > I haven't tried this, but you could try to recreate your old namespace > as a namespace full of aliases. > It will contain only shared vars, each named as an old class and > initialized to contain a reference to the new class. > > R > - > > > On 4/11/2012 9:26 AM, Rob Vens wrote: >> I have the situation that I want to replace a top-level namespace with >> another. >> I have saved objects in BOSS or a parcel, and those objects are >> instances of classes in the namespace, say, Sepher.LogSim. >> Now I want to load those objects in a system that has the the same >> domain object classes, but now in namespace Reflektis.LogSim. >> Is there a way to substitute namespaces? I looked into >> NameSpaceSearchRules but I could not find a valid strategy. >> >> _______________________________________________ >> vwnc mailing list >> [hidden email] >> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc >> > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |