This didn't make it to the list, so ...
-------- Original Message -------- Subject: Re: Magma Seaside package? Date: Tue, 30 Jan 2007 22:31:05 -0300 From: Ramiro Diaz Trepat ramirodt@gmail.com To: Jens Pall jens@axonspace.com
Yes Göran, it would be really great to have a stripped down version of your Gjallar to look at.
On 1/30/07, Jens Pall jens@axonspace.com wrote:
Göran Krampe wrote:
Btw, I have the intention of sitting down and "strip" Gjallar down to a very small example app which only does login/logut and has a trivial domain model. This way it could be used as a neat starting point for building an app.
I would be very much interested in such an example since I am trying to work my way towards using Magma along with Seaside. I installed Gjallar and found it a bit intimidating for a Smalltalk novice like me (besides having some trouble logging in at first :)
JP
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
Göran. Anything giving some understanding of how the pieces work together would be great.
I spent some time looking at the code. The goals of Gjallar are quite ambitious and splitting the approach in 'Done' modules/features might help.
Still the model was not an issue when I looked at the code. I was more impressed (and overwhelmed) with all the infrastructure code that had to be put in place to glue the pieces together. I think that this could be quite an obstacle from benefiting the Seaside/Magma productivity capabilties. Anything that could help there would be great.
Thanks,
Thierry
Hi!
"Thierry Thelliez" thierry.thelliez.tech@gmail.com wrote:
Göran. Anything giving some understanding of how the pieces work together would be great.
I will try posting a first shot tonight after my badminton, or tomorrow. I have started an article. :)
I spent some time looking at the code. The goals of Gjallar are quite ambitious and splitting the approach in 'Done' modules/features might help.
Yes, I plan to go over the website and document stuff like that.
Still the model was not an issue when I looked at the code. I was more impressed (and overwhelmed) with all the infrastructure code that had to be put in place to glue the pieces together. I think that this could be quite an obstacle from benefiting the Seaside/Magma productivity capabilties. Anything that could help there would be great.
Mmmm, not sure exactly. We have infrastructure for:
- Q2Scheduler and friends. That's the "cron" part. - Some Seaside components like Q2Navigation etc. - The Q2Txn framework which is quite special for Gjallar. - The Q2Form/Q2Field framework which is a tailored "Magritte" for Gjallar. - Q2MagmaMock classes in order to be able to execute the domain model "in RAM" without Magma. Good for speedy unit tests. - Some Session classes in order to be able to have a "common" API regardless if sessions run through Seaside or in some other way.
A lot of the above would not be needed for "another" app. But as I said - a stripped down Gjallar should be nice to be able to present. Will see if I can find the time.
regards, Göran
Thanks for taking the time to document some of that!
I found that there is a lot of code that could be reused in other applications. For example your Q2MagmaMock or Q2Log could benefit other applications.
More details about the motivations behind the classes in the following categories could help reading the code, I think. The very high level intent is understandable but drilling in the details is hard. Q2-HV Q2-Magma-addons Q2-Scheduler Q2-Seaside-addons Q2-Sessions Q2-Transactions Q2-Utilities Q2-Translation
Another area of confusion for me, not directly related to Gjallar, is the versioning mechanism in Squeak. I had started creating some code in 3.9 (learning from the Pier/Seaside/Magma application example). But I found hard to understand what will and will not work under 3.9 and/or the latest Seaside/Magma versions. I guess that this comment belongs to another discussion list ;-)
Happy badminton! Thierry
Hi!
(about to drop to bed, but a quick reply at least)
"Thierry Thelliez" thierry.thelliez.tech@gmail.com wrote:
Thanks for taking the time to document some of that!
I found that there is a lot of code that could be reused in other applications. For example your Q2MagmaMock or Q2Log could benefit other applications.
Yes, the magma mock stuff and/or the session classes should be reusable. Q2Log is trivially reusable - even though we now also have Toothpick (in the Squeak community) as a package for logging. I still like Q2Log. :)
More details about the motivations behind the classes in the following categories could help reading the code, I think. The very high level intent is understandable but drilling in the details is hard. Q2-HV
HV is short for HttpView - it is my own web framework that I built while Avi built Seaside. :) We use it only for some offline functions in Gjallar - ignore it. :)
Q2-Magma-addons
Currently holds two new index types. Magma allows creating new index types this way. One is for "unique objects" - objects that have a UUID in them. The other is custom for Gjallar (hence the Q2 prefix).
Q2-Scheduler
These are the classes that implement the "cron" mechanism in Gjallar - the ability to have recurring services wake up, run, go back to sleep. Q2Scheduler is the actual scheduler and has its own Process, see its class comment. To create a service you simply subclass Q2Service. We decided to play with the concept of using the classes themselves as the "singleton objects" for each service - so all behavior and state is on the class side.
And yes, all this is reusable in other apps. But in order to build a Magma/Seaside app these things are not needed. But in any complex system you will end up with the need for "things to happen" even when a user is not initiating it. The trivial example in Gjallar is the Q2PopService that pops email every 10 seconds or something.
Q2-Seaside-addons
Q2BatchedList is a special batch list that operates on a MagmaReader. It has a class comment. Q2Canvas is a special WACanvas subclass that adds a few "HTML building" methods - mostly for stuff like tooltips and our forms stuff etc.
Q2-Sessions
Holds three different session classes - Q2Session is our Seaside session subclass which pairs a Magma session with it etc. Q2SessionWithoutSeaside is the one we use especially when we run Q2Services in the scheduler (no Seaside session then of course!) or when we react on SOAP requests etc. Q2MockSession is for running unit tests and makes especially sure that we use a Q2MockMagmaSession - a mock Magma session.
Q2MockMagmaCollection is an attempt to "emulate" MagmaCollections, again for unit tests. Q2MagmaSessionPool is our own implementation of a session pool for Magma, should be reusable after cleanup.
Generally Q2Session and Q2MagmaSessionPool are the important guys here, but typically you wouldn't need to bother with the pool - it does its work under the covers.
Q2-Transactions
This is very Gjallar specific. Gjallar uses a design pattern called "Commands" (IIRC) heavily in order to be able to work offline. In other words, whenever we change anything in the domain model we instantiate a correct Q2Txn subclass, fill it with the correct data, let it do its work. Then we save them in an ever longer MagmaCollection. A lot like Prevayler or similar systems - a Gjallar system has full historic data and should be able to replay all transactions in series and in theory get us back to where we are.
Q2-Utilities
A bunch of odd ends, lots of them reusable. Can't go through them in this email. :)
Q2-Translation
A new category created by Balazs and Levente with some mechanisms allowing us to translate Gjallar to multiple languages. They of course want hungarian. :) And we would probably like to do swedish eventually.
Another area of confusion for me, not directly related to Gjallar, is the versioning mechanism in Squeak. I had started creating some code in 3.9 (learning from the Pier/Seaside/Magma application example). But I found hard to understand what will and will not work under 3.9 and/or the latest Seaside/Magma versions. I guess that this comment belongs to another discussion list ;-)
Mmmm, not sure I can answer without more details. :)
Happy badminton! Thierry
Thanks. :)
regards, Göran
magma@lists.squeakfoundation.org