What strategy to use when developing applications with GST?

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

What strategy to use when developing applications with GST?

ZuLuuuuuu
Hello,

I was trying to port a sample Iliad application of mine from Squeak to GST. I'm having difficulty what steps I should follow while developing my app with GST (I know the question is not very explanatory yet).

Here is the first solution I applied, step by step:

1) I wrote my widgets and application into their respective .st files.

2) I want to test my application. So I created a remote GST using an image with Iliad pre-loaded:

gst-remote --server -I ../iliad.im

3) I started the Swazoo Iliad server:

gst-remote -e "(Iliad.SwazooIliad startOn:8888) printNl"

4) I created a file, which files in my other files:

gst-remote -e "(FileStream fileIn: 'MyFileIn.st') printNl

The problem with this approach is that I need to put

Namespace current: Iliad []

around all my classes to keep it organized. The good side of this approach is that it is easy :) Just keep doing step 4 when you modify a method. And if you do a modification like changing a class' or method's name or remove one completely, restart the remote GST and file in your MyFileIn.st again. So that you don't have unnecessary methods or classes on your running image.

Question 1: I guess this is not the way I should develop my applications?

The second solution is to use package system of GNU Smalltalk. First three steps are the same with above. Then I proceeded like this:

4) I created a package.xml with an appropriate content.

5) Executed gst-package on this package.xml to create a .star file as root user (or could use --target-directory flag to create it on my ~/.st directory).

6) Then loaded the package in with:

gst-remote -e "(PackageLoader fileInPackage: 'Iliad-More-MyApp') printNl"

Question 2: Is this the way how I should develop my application?

Question 3: When I modify something, I recreate the package and try to load the new package in, I guess it does not load it because it is already loaded. So my changes do not take effect. How can I force PackageLoader to load the new package in? There is a flag for it on gst-load but I couldn't figure out how can I apply it on my remote GST's image. I can stop the server, apply gst-load with force option but then my iliad.im will be permanently changed. I can create an image with different name but doing this every time I do a change didn't seem practical.

The third solution would be to use gst-browser:

1) Open gst-browser on an image with Iliad preloaded:

gst-browser -I "iliad.im"

2) Start Swazoo Iliad server via

Iliad.SwazooIliad startOn:8888

3) Create your application's classes and methods.

4) Just go test your application on browser and see your modifications without doing any package loading.

The upside is that you can use "ILErrorHandler debugMode" to debug your application alive.

Question 4: "ILErrorHandler debugMode" is supposed to be used when you are developing with the browser right? When you don't use the browser you should find out bugs from the error message displayed on the browser?

Question 5: When using the gst-browser, should I use the file out feature to keep my application on a VCS like Git or Bazaar? Or am I supposed to use a solution inside the browser to keep track of my code. I guess this is how it is done in Squeak, Dolphin etc?

Question 6: Again, when deploying my application would using the file out feature (and then preparing the .star package) be an elegant solution or when you develope an application on the browser it is supposed to be distributed via the image file?

Question 7: Does anybody use gst-browser to develop real applications yet? It seems to be giving errors for some basic things like creating a class :(

Achievement gained: Reading a long newbie question from start till the end.

Canol

* Some of the questions are related to GST in general that's why I posted here instead of the Iliad group.
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: What strategy to use when developing applications with GST?

Paolo Bonzini-2
On 08/18/2010 04:15 PM, ZuLuuuuuu wrote:
> gst-remote --server -I ../iliad.im
> gst-remote -e "(Iliad.SwazooIliad startOn:8888) printNl"

So far so good.

> 4) gst-remote -e "(FileStream fileIn: 'MyFileIn.st') printNl

Or gst-remote -f MyFileIn.st

> The problem with this approach is that I need to put
>
> Namespace current: Iliad []
>
> around all my classes to keep it organized.

Just put this in MyFileIn.st instead.  However, I suggest you use
another namespace for your application, and import Iliad in it using the
#import: pragma:

Namespace current: YourNamespace [
     <import: Iliad>

     ...
]

> The second solution is to use package system of GNU Smalltalk. First three
> steps are the same with above. Then I proceeded like this:
>
> 4) I created a package.xml with an appropriate content.
>
> 5) Executed gst-package on this package.xml to create a .star file as root
> user (or could use --target-directory flag to create it on my ~/.st
> directory).

Do use --target-directory.  Use iliad.im's directory instead of ~/.st.

BTW you'll still need a way to import the Iliad namespace if you use the
technique I suggested above, for example a small file containing only

Eval [
     Namespace current import: Iliad
]

> 6) Then loaded the package in with:
>
> gst-remote -e "(PackageLoader fileInPackage: 'Iliad-More-MyApp') printNl"
>
> Question 2: Is this the way how I should develop my application?

It could be.

> Question 3: When I modify something, I recreate the package and try to load
> the new package in, I guess it does not load it because it is already
> loaded. So my changes do not take effect. How can I force PackageLoader to
> load the new package in?

Smalltalk removeFeature: #'Iliad-More-MyApp'.
PackageLoader fileInPackage: 'Iliad-More-MyApp'.

You can put this in a single gst-remote invocation and put that in a script.

> Question 5: When using the gst-browser, should I use the file out feature to
> keep my application on a VCS like Git or Bazaar? Or am I supposed to use a
> solution inside the browser to keep track of my code. I guess this is how it
> is done in Squeak, Dolphin etc?

Use a VCS.

> Question 6: Again, when deploying my application would using the file out
> feature (and then preparing the .star package) be an elegant solution or
> when you develope an application on the browser it is supposed to be
> distributed via the image file?

Distribute using .star packages.

> Question 7: Does anybody use gst-browser to develop real applications yet?
> It seems to be giving errors for some basic things like creating a class :(

I think Nicolas and Sebastien do sometimes use it, since they reported
bugs, but I'm not sure.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: What strategy to use when developing applications with GST?

Nicolas Petton
In reply to this post by ZuLuuuuuu
Le mercredi 18 août 2010 à 07:15 -0700, ZuLuuuuuu a écrit :
> Hello,
>
Hi Canol!

First of all, it's cool to have questions about Iliad, please keep
posting! :p
Also, I Cced to Iliad mailing list, I hope you don't mind.

> I was trying to port a sample Iliad application of mine from Squeak to GST.
> I'm having difficulty what steps I should follow while developing my app
> with GST (I know the question is not very explanatory yet).
>
> Here is the first solution I applied, step by step:
>
> 1) I wrote my widgets and application into their respective .st files.
>
> 2) I want to test my application. So I created a remote GST using an image
> with Iliad pre-loaded:
>
> gst-remote --server -I ../iliad.im
>
> 3) I started the Swazoo Iliad server:
>
> gst-remote -e "(Iliad.SwazooIliad startOn:8888) printNl"
>
> 4) I created a file, which files in my other files:
>
> gst-remote -e "(FileStream fileIn: 'MyFileIn.st') printNl
>
> The problem with this approach is that I need to put
>
> Namespace current: Iliad []
>
> around all my classes to keep it organized. The good side of this approach
> is that it is easy :) Just keep doing step 4 when you modify a method. And
> if you do a modification like changing a class' or method's name or remove
> one completely, restart the remote GST and file in your MyFileIn.st again.
> So that you don't have unnecessary methods or classes on your running image.
>
> Question 1: I guess this is not the way I should develop my applications?
If I understand you correctly, you use the Iliad namespace to develop
your application. You shouldn't do this, since your application is not
Iliad itself. It's also true for the IL prefix, it's supposed to be used
for Iliad classes only.

> 4) I created a package.xml with an appropriate content.

Better :)

> 6) Then loaded the package in with:
>
> gst-remote -e "(PackageLoader fileInPackage: 'Iliad-More-MyApp') printNl"

Again, you should name your package differently, unless you plan to
contribute it to Iliad ;)

> Question 2: Is this the way how I should develop my application?

Yes, that's what I do at least, using star packages.

> Question 3: When I modify something, I recreate the package and try to load
> the new package in, I guess it does not load it because it is already
> loaded. So my changes do not take effect. How can I force PackageLoader to
> load the new package in? There is a flag for it on gst-load but I couldn't
> figure out how can I apply it on my remote GST's image. I can stop the
> server, apply gst-load with force option but then my iliad.im will be
> permanently changed. I can create an image with different name but doing
> this every time I do a change didn't seem practical.

Here we have scripts to automatically rebuild the image and reload the
packages. There is one in Iliad in the scripts directory too.
http://github.com/NicolasPetton/iliad/blob/master/scripts/start



> The third solution would be to use gst-browser:
>
> 1) Open gst-browser on an image with Iliad preloaded:
>
> gst-browser -I "iliad.im"
>
> 2) Start Swazoo Iliad server via
>
> Iliad.SwazooIliad startOn:8888
>
> 3) Create your application's classes and methods.
>
> 4) Just go test your application on browser and see your modifications
> without doing any package loading.
>
> The upside is that you can use "ILErrorHandler debugMode" to debug your
> application alive.
>
> Question 4: "ILErrorHandler debugMode" is supposed to be used when you are
> developing with the browser right? When you don't use the browser you should
> find out bugs from the error message displayed on the browser?
>
Mostly, yes. Sometimes I use the debug mode with the MiniDebugger in my
console.

> Question 5: When using the gst-browser, should I use the file out feature to
> keep my application on a VCS like Git or Bazaar? Or am I supposed to use a
> solution inside the browser to keep track of my code. I guess this is how it
> is done in Squeak, Dolphin etc?

I can't answer to this question, since I am myself waiting for a package
management with Git integration in VisualGST ;)

> Question 6: Again, when deploying my application would using the file out
> feature (and then preparing the .star package) be an elegant solution or
> when you develope an application on the browser it is supposed to be
> distributed via the image file?
>
> Question 7: Does anybody use gst-browser to develop real applications yet?
> It seems to be giving errors for some basic things like creating a class :(

I use it sometimes to read code. I tried several times to develop using
it, and VisualGST is _really cool_, but some features are really missing
for me. (Sorry Gwen& Paolo)

On the other hand, I would really love to be able to use this IDE
sometimes instead of a text editor. Go VisualGST go!

Cheers,

--
Nicolas Petton

ObjectFusion S.A.R.L.
Applications web, consulting, design
http://www.objectfusion.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: What strategy to use when developing applications with GST?

Nicolas Petton
In reply to this post by Paolo Bonzini-2
Le mercredi 18 août 2010 à 16:31 +0200, Paolo Bonzini a écrit :

> Just put this in MyFileIn.st instead.  However, I suggest you use
> another namespace for your application, and import Iliad in it using
> the
> #import: pragma:
>
> Namespace current: YourNamespace [
>      <import: Iliad>
>
>      ...
> ]
Cool, I didn't know this pragma :)

--
Nicolas Petton

ObjectFusion S.A.R.L.
Applications web, consulting, design
http://www.objectfusion.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Iliad] Re: [Help-smalltalk] What strategy to use when developing applications with GST?

Paolo Bonzini-2
In reply to this post by Nicolas Petton
> Mostly, yes. Sometimes I use the debug mode with the MiniDebugger in my
> console.

Whoa, somebody uses it?!?!?!? :-P

You should really blog about it. :)

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: What strategy to use when developing applications with GST?

ZuLuuuuuu
In reply to this post by Nicolas Petton
Nicolas Petton wrote
Hi Canol!

First of all, it's cool to have questions about Iliad, please keep
posting! :p
I will :)

Nicolas Petton wrote
Also, I Cced to Iliad mailing list, I hope you don't mind.
No, not at all.

Thanks all for your answers, I got a lot of questions, which I wonder for a long time, answered :)
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: [Iliad] Re: [Help-smalltalk] What strategy to use when developing applications with GST?

Nicolas Petton
In reply to this post by Paolo Bonzini-2
Le mercredi 18 août 2010 à 17:23 +0200, Paolo Bonzini a écrit :
> > Mostly, yes. Sometimes I use the debug mode with the MiniDebugger in my
> > console.
>
> Whoa, somebody uses it?!?!?!? :-P

Hehe :) Yes, I use it and it's pretty useful ;)
>
> You should really blog about it. :)

Good idea, I never thought about it.

Cheers,
--
Nicolas Petton

ObjectFusion S.A.R.L.
Applications web, consulting, design
http://www.objectfusion.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (205 bytes) Download Attachment