Best practices available for Seaside Gemstone?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
55 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

James Foster-8

On Oct 7, 2010, at 1:09 AM, Friedrich Dominicus wrote:

> Norbert Hartl <[hidden email]> writes:
>
>> On 06.10.2010, at 19:07, Jon Paynter wrote:
>>
>>
>>    ok im a little confused here.
>>
>>    While everything Norbert said works great - whats stopping you from
>>    starting your development in gemstone and just using the Pharo image as a
>>    front end?
>>
>>
>> Well, nothing :) What I wrote is just the complete process. After I started
>> with gemstone I did exactly this. I had a local installation on my laptop and I
>> just connected from pharo to the gemstone and developed there. It is working
>> well, only the development tools are a bit older and there is some latency
>> between keyboard actions and visual feedback but ok.
>> If you are planning to work on a remote gemstone than you will immediately see
>> that it does not work that well.
> May I ask something here again. So I have my Gemstone running on the
> same machine as the GemTools so I see the latency even while working in
> "local" mode. It's not much but one "sees" it.

I wonder if the delay you are seeing is due to GemTools doing a commit after every action (rather than network latency). I believe there is a menu option to turn that off (I don't have GemTools up right now to check). Of course, then you need to manually commit or else you could lose your work.

James

> So you are not even
> having a kind of "development" gemstone, but really am just working in
> the Pharo image?
>
> Regards
> Friedrich
>
> --
> Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
> Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

FDominicus
James Foster <[hidden email]> writes:

> I wonder if the delay you are seeing is due to GemTools doing a commit
> after every action (rather than network latency). I believe there is a
> menu option to turn that off (I don't have GemTools up right now to
> check). Of course, then you need to manually commit or else you could
> lose your work.
Maybe it's because the gemstone library is quite large? I figures out
that the Gemstone/Seaside combination is set to autocommit. I'd think
that most of the Gemstone stuff still may fit into memory but I'm not
that much into all the libarries for asking Gemstone about it. It's not
really a disturbing thing it's just that one recognices it.

Regards
Friedrich


--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

SeanTAllen
In reply to this post by James Foster-8


On Thu, Oct 7, 2010 at 6:40 AM, James Foster <[hidden email]> wrote:

On Oct 7, 2010, at 1:09 AM, Friedrich Dominicus wrote:

> Norbert Hartl <[hidden email]> writes:
>
>> On 06.10.2010, at 19:07, Jon Paynter wrote:
>>
>>
>>    ok im a little confused here.
>>
>>    While everything Norbert said works great - whats stopping you from
>>    starting your development in gemstone and just using the Pharo image as a
>>    front end?
>>
>>
>> Well, nothing :) What I wrote is just the complete process. After I started
>> with gemstone I did exactly this. I had a local installation on my laptop and I
>> just connected from pharo to the gemstone and developed there. It is working
>> well, only the development tools are a bit older and there is some latency
>> between keyboard actions and visual feedback but ok.
>> If you are planning to work on a remote gemstone than you will immediately see
>> that it does not work that well.
> May I ask something here again. So I have my Gemstone running on the
> same machine as the GemTools so I see the latency even while working in
> "local" mode. It's not much but one "sees" it.

I wonder if the delay you are seeing is due to GemTools doing a commit after every action (rather than network latency). I believe there is a menu option to turn that off (I don't have GemTools up right now to check). Of course, then you need to manually commit or else you could lose your work.

It is still fairly flow even with the auto commit off. 
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

SeanTAllen


On Thu, Oct 7, 2010 at 9:19 AM, Sean Allen <[hidden email]> wrote:


On Thu, Oct 7, 2010 at 6:40 AM, James Foster <[hidden email]> wrote:

On Oct 7, 2010, at 1:09 AM, Friedrich Dominicus wrote:

> Norbert Hartl <[hidden email]> writes:
>
>> On 06.10.2010, at 19:07, Jon Paynter wrote:
>>
>>
>>    ok im a little confused here.
>>
>>    While everything Norbert said works great - whats stopping you from
>>    starting your development in gemstone and just using the Pharo image as a
>>    front end?
>>
>>
>> Well, nothing :) What I wrote is just the complete process. After I started
>> with gemstone I did exactly this. I had a local installation on my laptop and I
>> just connected from pharo to the gemstone and developed there. It is working
>> well, only the development tools are a bit older and there is some latency
>> between keyboard actions and visual feedback but ok.
>> If you are planning to work on a remote gemstone than you will immediately see
>> that it does not work that well.
> May I ask something here again. So I have my Gemstone running on the
> same machine as the GemTools so I see the latency even while working in
> "local" mode. It's not much but one "sees" it.

I wonder if the delay you are seeing is due to GemTools doing a commit after every action (rather than network latency). I believe there is a menu option to turn that off (I don't have GemTools up right now to check). Of course, then you need to manually commit or else you could lose your work.

It is still fairly flow even with the auto commit off. 

/flow/slow/
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

dassi
In reply to this post by Bart Veenstra

Am 07.10.2010 um 12:05 schrieb Bart Veenstra:

> I agree that it adds extra security, but the length is quite long (36
> byte string). Do you also use these UID as key in a dictionary with
> every instance, even from different classes.  for lookup?
>

No. I just use #detect: to find the object in the collection. I have  
no performance optimizations for this so far, since a) I have only few  
data b) The direct access with an URL is not the normal case and c) it  
will search for that article only once on the very first access (not  
like for example in Rails where *every* access needs to fetch the  
object with the ID from the database)

If I will have to optimize performance, I would try to use GemStone  
indexes first, and then probably your mentioned lookup dictionary, or  
even a different "caching" strategy, where I would store the "100 most  
probable" objects in a separate "fast lookup collection".

Greetings, Andreas


> 2010/10/7 Brodbeck Andreas <[hidden email]>:
>>
>> Am 04.10.2010 um 22:08 schrieb Bart Veenstra:
>>
>>> I know, but I need to access my object graph by URL.
>>>
>>> for instance:
>>>
>>> sandmin?path=sandmin/questioncategories/questioncategory_general/
>>> question_Leeftijd
>>>
>>> I use this to traverse to the object and have it displayed. I like
>>> human readable url's. Good for search engines to. Using JQuery  
>>> address
>>> I even change the url in my ajax application:
>>>
>>>
>>> http://files.extractivity.com/questionmanager/sandmin#/sandmin/ 
>>> questioncategories/questioncategory_general/question_Leeftijd/
>>> questionComponents
>>>
>>> The values after path and # are references to unique id's in my  
>>> object
>>> model
>>> Sandmin -> questioncategorylist -> General Question -> Question  
>>> Leeftijd
>>> (age)
>>>
>>> But for some things, I would like to have generated id's. What is  
>>> the
>>> best way to achieve this?
>>
>> I had a similar need in an application, where I send out emails to  
>> users
>> with a link back to the application. The link will contain an ID of  
>> a piece
>> of content which will then be displayed. I am using instances of  
>> UUID (id :=
>> UUID new.) to generate a unique ID which identifies the object to  
>> display. I
>> like the Uuid approach better than an increasing integer counter,  
>> because it
>> adds extra "security", since it is much harder to guess existing IDs.
>>
>> Greetings, Andreas
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Dale Henrichs
In reply to this post by FDominicus
On 10/06/2010 10:09 PM, Friedrich Dominicus wrote:

> Norbert Hartl<[hidden email]>  writes:
>
>> On 06.10.2010, at 19:07, Jon Paynter wrote:
>>
>>
>>      ok im a little confused here.
>>
>>      While everything Norbert said works great - whats stopping you from
>>      starting your development in gemstone and just using the Pharo image as a
>>      front end?
>>
>>
>> Well, nothing :) What I wrote is just the complete process. After I started
>> with gemstone I did exactly this. I had a local installation on my laptop and I
>> just connected from pharo to the gemstone and developed there. It is working
>> well, only the development tools are a bit older and there is some latency
>> between keyboard actions and visual feedback but ok.
>> If you are planning to work on a remote gemstone than you will immediately see
>> that it does not work that well.
> May I ask something here again. So I have my Gemstone running on the
> same machine as the GemTools so I see the latency even while working in
> "local" mode. It's not much but one "sees" it. So you are not even
> having a kind of "development" gemstone, but really am just working in
> the Pharo image?
>
> Regards
> Friedrich
>

The latency is there because of the way that GemTools works. For
GemTools I took OmniBrowser and split it down the middle.

The morphic client is running in the Pharo image and displays the
windows. The OmniBrowser model is running in the GemStone vm. I have
arranged for one set of proxy objects on the GemStone side to represent
the Morphic Model resident in Pharo and another set of proxy objects in
the Pharo vm to represent the OmniBrowser model resident in GemStone.

When you click on a menu item (Morphic), the message is sent across the
wire from the Pharo-side proxy to the GemStone OmniBrowser model. Work
gets done (in GemStone) and if there is a change to the window state,
OmniBrowser triggers #changed: messages which result in #update:
messages being sent across the wire from the GemStone-side Morphic proxy
to the Morphic Model running in Pharo. The Morphic model sends messages
requesting state from the OmniBrowser proxy and those messages get sent
across the wire to get things like lists of classes, methods, and source
code ...

In a nutshell, OmniBrowser/Morhpic is very chatty when it comes to these
update messages (i.e., the button panels that show up in the browsers is
redrawn for every button that is in the panel and that can add up to a
lot of round trips across the wire).

Soooo, if you want the fastest response times possible, then develop in
Pharo natively where the chattiness doesn't slow down response times:)

I have done some things that attempted to minimize the round trips for
OmniBrowser, but I haven't been able to get a big enough gain, yet.

I think that ultimately a performant solution can be found, but I just
haven't had the time to focus on that ... Doing development in Pharo has
advantages above and beyond speed, so speeding up GemTools hasn't been
at the top of my list....

Dale
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Bart Veenstra
In reply to this post by dassi
I am going for the persistent counter option. I understands that
System provides several counters. Should all my classes use the same
counter index? Of should I provide a counter for each class. IMHO it
doesn't really matter..

2010/10/7 Brodbeck Andreas <[hidden email]>:

>
> Am 07.10.2010 um 12:05 schrieb Bart Veenstra:
>
>> I agree that it adds extra security, but the length is quite long (36
>> byte string). Do you also use these UID as key in a dictionary with
>> every instance, even from different classes.  for lookup?
>>
>
> No. I just use #detect: to find the object in the collection. I have no
> performance optimizations for this so far, since a) I have only few data b)
> The direct access with an URL is not the normal case and c) it will search
> for that article only once on the very first access (not like for example in
> Rails where *every* access needs to fetch the object with the ID from the
> database)
>
> If I will have to optimize performance, I would try to use GemStone indexes
> first, and then probably your mentioned lookup dictionary, or even a
> different "caching" strategy, where I would store the "100 most probable"
> objects in a separate "fast lookup collection".
>
> Greetings, Andreas
>
>
>> 2010/10/7 Brodbeck Andreas <[hidden email]>:
>>>
>>> Am 04.10.2010 um 22:08 schrieb Bart Veenstra:
>>>
>>>> I know, but I need to access my object graph by URL.
>>>>
>>>> for instance:
>>>>
>>>>
>>>> sandmin?path=sandmin/questioncategories/questioncategory_general/question_Leeftijd
>>>>
>>>> I use this to traverse to the object and have it displayed. I like
>>>> human readable url's. Good for search engines to. Using JQuery address
>>>> I even change the url in my ajax application:
>>>>
>>>>
>>>>
>>>> http://files.extractivity.com/questionmanager/sandmin#/sandmin/questioncategories/questioncategory_general/question_Leeftijd/questionComponents
>>>>
>>>> The values after path and # are references to unique id's in my object
>>>> model
>>>> Sandmin -> questioncategorylist -> General Question -> Question Leeftijd
>>>> (age)
>>>>
>>>> But for some things, I would like to have generated id's. What is the
>>>> best way to achieve this?
>>>
>>> I had a similar need in an application, where I send out emails to users
>>> with a link back to the application. The link will contain an ID of a
>>> piece
>>> of content which will then be displayed. I am using instances of UUID (id
>>> :=
>>> UUID new.) to generate a unique ID which identifies the object to
>>> display. I
>>> like the Uuid approach better than an increasing integer counter, because
>>> it
>>> adds extra "security", since it is much harder to guess existing IDs.
>>>
>>> Greetings, Andreas
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Dale Henrichs
On 10/07/2010 10:42 AM, Bart Veenstra wrote:
> I am going for the persistent counter option. I understands that
> System provides several counters. Should all my classes use the same
> counter index? Of should I provide a counter for each class. IMHO it
> doesn't really matter..

I would say that if it doesn't matter use the smae counter ... you have
64 bits so it will be a while before you run out of bits:)

There are limited number of counters, so it's best to be frugal.

Dale
Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Chris Curtis
In reply to this post by NorbertHartl
OK, I'm thoroughly frustrated.... how *do* I load MockGemStone? I've tried just about every incantation of Gofer I can think of (and Gofer project) but nothing can find it.

--chris

On Wed, Oct 6, 2010 at 3:34 AM, Norbert Hartl <[hidden email]> wrote:

On 06.10.2010, at 07:18, Friedrich Dominicus wrote:

> Dale Henrichs <[hidden email]> writes:
>> You _could_ use the same Pharo image for developing in Pharo and
>> GemStone, but for me it is too easy to forget where I'm making changes
>> (the code is the same and browsers look similar)..So I prefer to have
>> separate pharo vms: 1 for Pharo-based development and 1 for
>> GemTools-based defelopment.
> Let me be a bit more penetrant. As I understand the suggestion is "NOT"
> using the GemStone Tools (intergrated) into Pharo. But just writing the
> code "happy" away in the Pharo image. If you feel kind of comfortable
> you migrate than?
>
What you describe you have to do anyway. You write code anywhere than you need to create a monticello package and pull that back in into gemstone. I think Dales point was about how you work with images. You can have one image for your application and one for gemtools. Or you can have an image where the application and gemtools is installed. I think that is what Dale means with "you _could_ use the same". The latter approach can be confusing. Shortcuts do work in gemtools and in pharo. So while pressing cmd-B to get a browser it really depends which context you are working in. So you will often get e.g. a pharo system browser when your intension was to get one of gemstone.  All those things can go wrong.
I used the latter approach but I changed that. There are several good reasons for me to have it changed:

- it is indeed confusing if you are working with two different code bases in the same image. And sometimes I changed accidentially code in gemstone which I like to see as my production server and every change should come with monticello not by hand.
- I have several projects that are deployed in gemstone. No need to put the gemtools in every project image I have.
- if you like to be up to date to the pharo enhancements than the gemtools may prevent that. Until a few weeks ago you could only use pharo 1.0 for gemtools. Even in newer versions the tools that have been ported to gemstone are somewhat behind. So to divide project and gemtools image solves this problem

> I understand what you mean with the "Gemstone" image and the Pharo
> image. But the suggestion is doing development in Pharo FIRST?
>
Yep. I think it is not a good idea to work in both directions (pharo->gemstone and gemstone->pharo). In the beginning this might be the case until you are aware of cross platform problems. But to have a stable process is good to have. And that could be (it is nearly the same that Stephan writes):

- develop your application in pharo with the newest cool tools. That maximizes the fun for you
- write as much tests as it needs to trigger most of your code so you can detect errros early
- get used to Grease/SPort for streams and such. That helps to get around the most annoying thing in smalltalk: dialects
- use slime to check your code. Helps ironing out some mistakes that occurr often
- if you have code that needs gemstone internals than use MockGemstone to make it load in pharo and work in gemstone. If something is missing just add it to the MockGemstone package it is supposed to be used like that
- if you need some pharo methods that aren't present in gemstone than you can add them to the Squeak compatibility package in gemstone
- write a metacello configuration to wire all dependent libraries to your project
- write a upgrading/migrating utility class because sometimes you need to adjust something in the remote image and shouldn't do this manually

I like to say that taking all of these into account you will make it to deploy easily in gemstone. There are always nuts and bolts that don't fit that well. But as you get used to the process the rate will be decreasing. With metacello it is easy to have a configuration of the stable version of your application and one for development. You could than install the stable on production servers and the developement version on a test server.

> And you write your code such that it "ends" in a Monticello repository.
> Then you do the migration by checking it out the Monticello repository
> and "start porting" ?
>
>
No, if you take all the advizes from above you just write code that runs in both. Porting is always kind of a last resort. Dale is doing a lot to lower the barrier between pharo and gemstone. For what does not fit there are Squeak compatibility package, MockGemstone and method extensions in monticello. With the advent of metacello you can have a package split into cross-platform code and platform-dependent code. Platform-dependent code is put into a platform package. Metacello can load the right packages automatically. And so on and on and....

hope this gives a little insight,

Norbert
> --
> Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
> Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus


Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

NorbertHartl

On 15.10.2010, at 03:17, Chris Curtis wrote:

OK, I'm thoroughly frustrated.... how *do* I load MockGemStone? I've tried just about every incantation of Gofer I can think of (and Gofer project) but nothing can find it.

That is not your fault :) Gofer is one of the tools that are rather new. They work good but there hasn't been a complete shift towards Gofer (and it probably never will). While there are new tools to load sources they all use monticello which is the package management underneath. Most of the packages you will find in pharo/squeak/gemstone world will be somehow loadable by monticello.
In order to load MockGemStone just do the following:

- Copy the snippet in the Registration section to the clipboard.  
- Open a monticello browser
- Press the "+Repository" button followed by the option "HTTP"
- Replace the content shown with the content of the clipboard. Then "Accept"
- If you press "open" on the monticello browser while your new repository is highlighted you will see MockGemStone in the left pane. 
- Select MockGemstone then you got the versions on the right side. Usually you select the top most entry and then you press load

hope this helps,

Norbert

On Wed, Oct 6, 2010 at 3:34 AM, Norbert Hartl <[hidden email]> wrote:

On 06.10.2010, at 07:18, Friedrich Dominicus wrote:

> Dale Henrichs <[hidden email]> writes:
>> You _could_ use the same Pharo image for developing in Pharo and
>> GemStone, but for me it is too easy to forget where I'm making changes
>> (the code is the same and browsers look similar)..So I prefer to have
>> separate pharo vms: 1 for Pharo-based development and 1 for
>> GemTools-based defelopment.
> Let me be a bit more penetrant. As I understand the suggestion is "NOT"
> using the GemStone Tools (intergrated) into Pharo. But just writing the
> code "happy" away in the Pharo image. If you feel kind of comfortable
> you migrate than?
>
What you describe you have to do anyway. You write code anywhere than you need to create a monticello package and pull that back in into gemstone. I think Dales point was about how you work with images. You can have one image for your application and one for gemtools. Or you can have an image where the application and gemtools is installed. I think that is what Dale means with "you _could_ use the same". The latter approach can be confusing. Shortcuts do work in gemtools and in pharo. So while pressing cmd-B to get a browser it really depends which context you are working in. So you will often get e.g. a pharo system browser when your intension was to get one of gemstone.  All those things can go wrong.
I used the latter approach but I changed that. There are several good reasons for me to have it changed:

- it is indeed confusing if you are working with two different code bases in the same image. And sometimes I changed accidentially code in gemstone which I like to see as my production server and every change should come with monticello not by hand.
- I have several projects that are deployed in gemstone. No need to put the gemtools in every project image I have.
- if you like to be up to date to the pharo enhancements than the gemtools may prevent that. Until a few weeks ago you could only use pharo 1.0 for gemtools. Even in newer versions the tools that have been ported to gemstone are somewhat behind. So to divide project and gemtools image solves this problem

> I understand what you mean with the "Gemstone" image and the Pharo
> image. But the suggestion is doing development in Pharo FIRST?
>
Yep. I think it is not a good idea to work in both directions (pharo->gemstone and gemstone->pharo). In the beginning this might be the case until you are aware of cross platform problems. But to have a stable process is good to have. And that could be (it is nearly the same that Stephan writes):

- develop your application in pharo with the newest cool tools. That maximizes the fun for you
- write as much tests as it needs to trigger most of your code so you can detect errros early
- get used to Grease/SPort for streams and such. That helps to get around the most annoying thing in smalltalk: dialects
- use slime to check your code. Helps ironing out some mistakes that occurr often
- if you have code that needs gemstone internals than use MockGemstone to make it load in pharo and work in gemstone. If something is missing just add it to the MockGemstone package it is supposed to be used like that
- if you need some pharo methods that aren't present in gemstone than you can add them to the Squeak compatibility package in gemstone
- write a metacello configuration to wire all dependent libraries to your project
- write a upgrading/migrating utility class because sometimes you need to adjust something in the remote image and shouldn't do this manually

I like to say that taking all of these into account you will make it to deploy easily in gemstone. There are always nuts and bolts that don't fit that well. But as you get used to the process the rate will be decreasing. With metacello it is easy to have a configuration of the stable version of your application and one for development. You could than install the stable on production servers and the developement version on a test server.

> And you write your code such that it "ends" in a Monticello repository.
> Then you do the migration by checking it out the Monticello repository
> and "start porting" ?
>
>
No, if you take all the advizes from above you just write code that runs in both. Porting is always kind of a last resort. Dale is doing a lot to lower the barrier between pharo and gemstone. For what does not fit there are Squeak compatibility package, MockGemstone and method extensions in monticello. With the advent of metacello you can have a package split into cross-platform code and platform-dependent code. Platform-dependent code is put into a platform package. Metacello can load the right packages automatically. And so on and on and....

hope this gives a little insight,

Norbert
> --
> Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
> Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus



Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Chris Curtis
Worked great, thanks.

Of course, I then couldn't resist poking around in Gofer a little, and I figured out that this incantation will work (though I have no idea how 'optimal' it is):

Gofer new
  gemsource: 'MockGemStone' ;
  package: 'MockGemStone' ;
load.

--chris

On Fri, Oct 15, 2010 at 3:46 AM, Norbert Hartl <[hidden email]> wrote:

On 15.10.2010, at 03:17, Chris Curtis wrote:

OK, I'm thoroughly frustrated.... how *do* I load MockGemStone? I've tried just about every incantation of Gofer I can think of (and Gofer project) but nothing can find it.

That is not your fault :) Gofer is one of the tools that are rather new. They work good but there hasn't been a complete shift towards Gofer (and it probably never will). While there are new tools to load sources they all use monticello which is the package management underneath. Most of the packages you will find in pharo/squeak/gemstone world will be somehow loadable by monticello.
In order to load MockGemStone just do the following:

- Copy the snippet in the Registration section to the clipboard.  
- Open a monticello browser
- Press the "+Repository" button followed by the option "HTTP"
- Replace the content shown with the content of the clipboard. Then "Accept"
- If you press "open" on the monticello browser while your new repository is highlighted you will see MockGemStone in the left pane. 
- Select MockGemstone then you got the versions on the right side. Usually you select the top most entry and then you press load

hope this helps,

Norbert


On Wed, Oct 6, 2010 at 3:34 AM, Norbert Hartl <[hidden email]> wrote:

On 06.10.2010, at 07:18, Friedrich Dominicus wrote:

> Dale Henrichs <[hidden email]> writes:
>> You _could_ use the same Pharo image for developing in Pharo and
>> GemStone, but for me it is too easy to forget where I'm making changes
>> (the code is the same and browsers look similar)..So I prefer to have
>> separate pharo vms: 1 for Pharo-based development and 1 for
>> GemTools-based defelopment.
> Let me be a bit more penetrant. As I understand the suggestion is "NOT"
> using the GemStone Tools (intergrated) into Pharo. But just writing the
> code "happy" away in the Pharo image. If you feel kind of comfortable
> you migrate than?
>
What you describe you have to do anyway. You write code anywhere than you need to create a monticello package and pull that back in into gemstone. I think Dales point was about how you work with images. You can have one image for your application and one for gemtools. Or you can have an image where the application and gemtools is installed. I think that is what Dale means with "you _could_ use the same". The latter approach can be confusing. Shortcuts do work in gemtools and in pharo. So while pressing cmd-B to get a browser it really depends which context you are working in. So you will often get e.g. a pharo system browser when your intension was to get one of gemstone.  All those things can go wrong.
I used the latter approach but I changed that. There are several good reasons for me to have it changed:

- it is indeed confusing if you are working with two different code bases in the same image. And sometimes I changed accidentially code in gemstone which I like to see as my production server and every change should come with monticello not by hand.
- I have several projects that are deployed in gemstone. No need to put the gemtools in every project image I have.
- if you like to be up to date to the pharo enhancements than the gemtools may prevent that. Until a few weeks ago you could only use pharo 1.0 for gemtools. Even in newer versions the tools that have been ported to gemstone are somewhat behind. So to divide project and gemtools image solves this problem

> I understand what you mean with the "Gemstone" image and the Pharo
> image. But the suggestion is doing development in Pharo FIRST?
>
Yep. I think it is not a good idea to work in both directions (pharo->gemstone and gemstone->pharo). In the beginning this might be the case until you are aware of cross platform problems. But to have a stable process is good to have. And that could be (it is nearly the same that Stephan writes):

- develop your application in pharo with the newest cool tools. That maximizes the fun for you
- write as much tests as it needs to trigger most of your code so you can detect errros early
- get used to Grease/SPort for streams and such. That helps to get around the most annoying thing in smalltalk: dialects
- use slime to check your code. Helps ironing out some mistakes that occurr often
- if you have code that needs gemstone internals than use MockGemstone to make it load in pharo and work in gemstone. If something is missing just add it to the MockGemstone package it is supposed to be used like that
- if you need some pharo methods that aren't present in gemstone than you can add them to the Squeak compatibility package in gemstone
- write a metacello configuration to wire all dependent libraries to your project
- write a upgrading/migrating utility class because sometimes you need to adjust something in the remote image and shouldn't do this manually

I like to say that taking all of these into account you will make it to deploy easily in gemstone. There are always nuts and bolts that don't fit that well. But as you get used to the process the rate will be decreasing. With metacello it is easy to have a configuration of the stable version of your application and one for development. You could than install the stable on production servers and the developement version on a test server.

> And you write your code such that it "ends" in a Monticello repository.
> Then you do the migration by checking it out the Monticello repository
> and "start porting" ?
>
>
No, if you take all the advizes from above you just write code that runs in both. Porting is always kind of a last resort. Dale is doing a lot to lower the barrier between pharo and gemstone. For what does not fit there are Squeak compatibility package, MockGemstone and method extensions in monticello. With the advent of metacello you can have a package split into cross-platform code and platform-dependent code. Platform-dependent code is put into a platform package. Metacello can load the right packages automatically. And so on and on and....

hope this gives a little insight,

Norbert
> --
> Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
> Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus




Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

NorbertHartl

On 15.10.2010, at 17:17, Chris Curtis wrote:

Worked great, thanks.

Of course, I then couldn't resist poking around in Gofer a little, and I figured out that this incantation will work (though I have no idea how 'optimal' it is):

Gofer new
  gemsource: 'MockGemStone' ;
  package: 'MockGemStone' ;
load.

I think it is pretty optimal :) I could have give this as well but then I'm also not that familiar with Gofer.

Norbert

--chris

On Fri, Oct 15, 2010 at 3:46 AM, Norbert Hartl <[hidden email]> wrote:

On 15.10.2010, at 03:17, Chris Curtis wrote:

OK, I'm thoroughly frustrated.... how *do* I load MockGemStone? I've tried just about every incantation of Gofer I can think of (and Gofer project) but nothing can find it.

That is not your fault :) Gofer is one of the tools that are rather new. They work good but there hasn't been a complete shift towards Gofer (and it probably never will). While there are new tools to load sources they all use monticello which is the package management underneath. Most of the packages you will find in pharo/squeak/gemstone world will be somehow loadable by monticello.
In order to load MockGemStone just do the following:

- Copy the snippet in the Registration section to the clipboard.  
- Open a monticello browser
- Press the "+Repository" button followed by the option "HTTP"
- Replace the content shown with the content of the clipboard. Then "Accept"
- If you press "open" on the monticello browser while your new repository is highlighted you will see MockGemStone in the left pane. 
- Select MockGemstone then you got the versions on the right side. Usually you select the top most entry and then you press load

hope this helps,

Norbert


On Wed, Oct 6, 2010 at 3:34 AM, Norbert Hartl <[hidden email]> wrote:

On 06.10.2010, at 07:18, Friedrich Dominicus wrote:

> Dale Henrichs <[hidden email]> writes:
>> You _could_ use the same Pharo image for developing in Pharo and
>> GemStone, but for me it is too easy to forget where I'm making changes
>> (the code is the same and browsers look similar)..So I prefer to have
>> separate pharo vms: 1 for Pharo-based development and 1 for
>> GemTools-based defelopment.
> Let me be a bit more penetrant. As I understand the suggestion is "NOT"
> using the GemStone Tools (intergrated) into Pharo. But just writing the
> code "happy" away in the Pharo image. If you feel kind of comfortable
> you migrate than?
>
What you describe you have to do anyway. You write code anywhere than you need to create a monticello package and pull that back in into gemstone. I think Dales point was about how you work with images. You can have one image for your application and one for gemtools. Or you can have an image where the application and gemtools is installed. I think that is what Dale means with "you _could_ use the same". The latter approach can be confusing. Shortcuts do work in gemtools and in pharo. So while pressing cmd-B to get a browser it really depends which context you are working in. So you will often get e.g. a pharo system browser when your intension was to get one of gemstone.  All those things can go wrong.
I used the latter approach but I changed that. There are several good reasons for me to have it changed:

- it is indeed confusing if you are working with two different code bases in the same image. And sometimes I changed accidentially code in gemstone which I like to see as my production server and every change should come with monticello not by hand.
- I have several projects that are deployed in gemstone. No need to put the gemtools in every project image I have.
- if you like to be up to date to the pharo enhancements than the gemtools may prevent that. Until a few weeks ago you could only use pharo 1.0 for gemtools. Even in newer versions the tools that have been ported to gemstone are somewhat behind. So to divide project and gemtools image solves this problem

> I understand what you mean with the "Gemstone" image and the Pharo
> image. But the suggestion is doing development in Pharo FIRST?
>
Yep. I think it is not a good idea to work in both directions (pharo->gemstone and gemstone->pharo). In the beginning this might be the case until you are aware of cross platform problems. But to have a stable process is good to have. And that could be (it is nearly the same that Stephan writes):

- develop your application in pharo with the newest cool tools. That maximizes the fun for you
- write as much tests as it needs to trigger most of your code so you can detect errros early
- get used to Grease/SPort for streams and such. That helps to get around the most annoying thing in smalltalk: dialects
- use slime to check your code. Helps ironing out some mistakes that occurr often
- if you have code that needs gemstone internals than use MockGemstone to make it load in pharo and work in gemstone. If something is missing just add it to the MockGemstone package it is supposed to be used like that
- if you need some pharo methods that aren't present in gemstone than you can add them to the Squeak compatibility package in gemstone
- write a metacello configuration to wire all dependent libraries to your project
- write a upgrading/migrating utility class because sometimes you need to adjust something in the remote image and shouldn't do this manually

I like to say that taking all of these into account you will make it to deploy easily in gemstone. There are always nuts and bolts that don't fit that well. But as you get used to the process the rate will be decreasing. With metacello it is easy to have a configuration of the stable version of your application and one for development. You could than install the stable on production servers and the developement version on a test server.

> And you write your code such that it "ends" in a Monticello repository.
> Then you do the migration by checking it out the Monticello repository
> and "start porting" ?
>
>
No, if you take all the advizes from above you just write code that runs in both. Porting is always kind of a last resort. Dale is doing a lot to lower the barrier between pharo and gemstone. For what does not fit there are Squeak compatibility package, MockGemstone and method extensions in monticello. With the advent of metacello you can have a package split into cross-platform code and platform-dependent code. Platform-dependent code is put into a platform package. Metacello can load the right packages automatically. And so on and on and....

hope this gives a little insight,

Norbert
> --
> Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
> Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus





Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Chris Curtis
In reply to this post by Ramon Leon-5
I'm a little late on this, but I thought it was worth mentioning a potential gotcha if you're *not* using something ActiveRecord-ish (that is, you're using regular GS-persisted objects): you can't make temporary changes to the objects. For example, you can't: 

(a) load a persisted UserProfile object,
(b) bind the accessors to form fields,
(c) allow the user to make changes, and then
(d) assume navigating away from the page will discard the changes.

The GemStone port of Seaside commits with every page render, so you can't actually do a rollback. To support this behavior, you'd have to create a (non-persistent) DTO from the persistent object, and then on a user-specified "save' action map the changes from the DTO back to the persistent domain object. Or at least, that's one solution.

As a (related) side note, is anyone aware of any work being done with CQRS in the Smalltalk world? 

--chris


On Thu, Sep 30, 2010 at 6:48 PM, Ramon Leon <[hidden email]> wrote:
On 9/30/2010 1:54 PM, Bart Veenstra wrote:
using Monticello. But now I am left with a system with no persistence
at all. I used Glorp with about 25 tables for my domain model,but it
was to hard to maintain, so that i why I moved to Gemstone. With glorp
I used the ActiveRecord approach. On the class side I had different
methods to find instances (by name or paging queries and stuff) and on
the instance side, i could call save or delete.

Since you're familiar with the active record approach and you want something simple to start with, attached is an ActiveRecord system for Gemstone that works pretty much like you'd expect.  Subclass GDActiveRecord, call GDActiveRecord installSubClasses, and use the api found on the class side of GDActiveRecord under queries.  Should get you up and running.  See the unit tests for examples of using it.

--
Ramon Leon
http://onsmalltalk.com

Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

NorbertHartl

On 15.10.2010, at 18:19, Chris Curtis wrote:

I'm a little late on this, but I thought it was worth mentioning a potential gotcha if you're *not* using something ActiveRecord-ish (that is, you're using regular GS-persisted objects): you can't make temporary changes to the objects. For example, you can't: 

(a) load a persisted UserProfile object,
(b) bind the accessors to form fields,
(c) allow the user to make changes, and then
(d) assume navigating away from the page will discard the changes.

The GemStone port of Seaside commits with every page render, so you can't actually do a rollback. To support this behavior, you'd have to create a (non-persistent) DTO from the persistent object, and then on a user-specified "save' action map the changes from the DTO back to the persistent domain object. Or at least, that's one solution.

As a (related) side note, is anyone aware of any work being done with CQRS in the Smalltalk world? 

I don't know what CQRS. I do all my stuff using magritte. Magritte is meta model description that has a lot of benefits. One is that if you generate a web component from an object the component gets a memento of that object as the model. All changes are written to the memento. If you later call commit on the memento it writes its values back to the object. If you don't commit nothing has changed. 

Norbert
 

On Thu, Sep 30, 2010 at 6:48 PM, Ramon Leon <[hidden email]> wrote:
On 9/30/2010 1:54 PM, Bart Veenstra wrote:
using Monticello. But now I am left with a system with no persistence
at all. I used Glorp with about 25 tables for my domain model,but it
was to hard to maintain, so that i why I moved to Gemstone. With glorp
I used the ActiveRecord approach. On the class side I had different
methods to find instances (by name or paging queries and stuff) and on
the instance side, i could call save or delete.

Since you're familiar with the active record approach and you want something simple to start with, attached is an ActiveRecord system for Gemstone that works pretty much like you'd expect.  Subclass GDActiveRecord, call GDActiveRecord installSubClasses, and use the api found on the class side of GDActiveRecord under queries.  Should get you up and running.  See the unit tests for examples of using it.

--
Ramon Leon
http://onsmalltalk.com


Reply | Threaded
Open this post in threaded view
|

Re: Best practices available for Seaside Gemstone?

Chris Curtis
On Fri, Oct 15, 2010 at 12:29 PM, Norbert Hartl <[hidden email]> wrote:

I don't know what CQRS. I do all my stuff using magritte. Magritte is meta model description that has a lot of benefits. One is that if you generate a web component from an object the component gets a memento of that object as the model. All changes are written to the memento. If you later call commit on the memento it writes its values back to the object. If you don't commit nothing has changed. 

Norbert
 

Ah, that's very cool. That just bumped "learn Magritte" to the top of my list. :)

 CQRS is Command-Query Responsibility Segregation. It's a design pattern that essentially isolates the domain objects from clients behind Command and Query abstractions (which are then handled by separate services). There are a lot of really interesting architectures and properties that it enables, though some of them are somewhat less-important when all your objects can be live everywhere all the time. ;-) Anyway, here's a very comprehensive summary: http://www.udidahan.com/2009/12/09/clarified-cqrs/

Off to learn Magritte, finally....

--chris
123