[GemStone-Smalltalk] Getting started with Gembuilder for VW
Annick Fron via GemStone-Smalltalk
gemstone-smalltalk at lists.gemtalksystems.com
Wed Nov 21 06:54:54 PST 2018
Hi Martin,
This was helpful.
But my main issue is that I have the same classes both in UserGlobals and UserClasses, and sometimes with a different version.
If I user the right click menu « create in Gs » on a class in a browser, it creates it in UserClasses. But if I define connectors, it adds the same class name in UserGlobals.
Besides, all my classes have a namespace, e.g. Compet.Competition.
What is the difference between:
GBSM evaluate: ‘MyClass myInstances’
and
MyNamespace.MyClass myInstances performOnGsServer: #myInstances
?
Best regards
Annick
> Le 21 nov. 2018 à 01:50, Martin McClure <martin.mcclure at gemtalksystems.com> a écrit :
>
> On 11/20/18 10:37 AM, Annick Fron via GemStone-Smalltalk wrote:
>> Hi,
>>
>> I have succeeded to connect 2 PCs using the same database, and I have defined classes in the base. Now I have a class inst var as a connector, and I am able to store one object in the server. But using the same connect with updateST, I am not able to get it back.
>>
>> Any idea how to debug ?
>>
>> Best regards
>>
>> Annick
>
> Hi Annick,
>
> Connectors have some limitiations. Class instvar connectors in
> particular have the limitation that changes in the variable's value
> cannot be automatically detected by GBS. Connectors for class variables
> don't have this limitiation.
>
> However, especially when getting started, you may find it easier to not
> use connectors for your data roots.
>
> Use connectors for your classes (you can do without them sometimes, but
> they're easy and reliable. Then, after login, you can "manually"
> replicate your data roots.
>
> Say you have on both client and server the class MyClass, with class
> instVar myInstances, and accessor methods for that variable.
>
> Since you have a class connector for MyClass, once you're logged in the
> client MyClass is automatically mapped to the server MyClass.
>
> To initialize the instance variable on the server, you could do this on
> the client:
>
> MyClass performOnGsServer: #myInstances: withArguments: (Array with:
> OrderedCollection new).
>
> then commit.
>
> Thereafter, after each login, you can have the client initialize itself
> from the server with:
>
> MyClass myInstances: (MyClass performOnGsServer: #myInstances).
>
> After that, the client and server OrderedCollections (in this example;
> could be just about any object) are mapped to each other and will
> automatically synchronize their state.
>
>
> I hope this has been helpful, and that I haven't completely
> misunderstood what you're trying to do.
>
> If you get things working as I've suggested above, then you can
> experiment with Connectors if you like. And keep asking questions! GBS
> is very general-purpose, and it can take a bit to learn what the more
> successful patterns of use are.
>
> Regards,
>
> -Martin
>
More information about the GemStone-Smalltalk
mailing list