[aida] Tutorial Questions

Janko Mivšek janko.mivsek at eranova.si
Sat Nov 29 10:51:31 CET 2008

Hi Randy, welcome to the list!

mjolnir64 na gmail.com wrote:

> I just finished working through the Address Book tutorial, and I have
> a few questions:

> 1) When you click a surname link in the Address Book, you're taken to
> the Address page.  Is it possible to have a "Return to Address Book"
> link on that page?  I didn't see an obvious way to do it because the
> ADemoAddressApp class has no knowledge of ADemoAddressBookApp.

You can have a return link if you domain model provides a back reference 
to parent object. In tutorial case you should introduce a parent 
instance variable in Address class and set up always when you add it to 
address book:

aDemoAddressBook>>addAddress: anAddress

     self addresses add: anAddress.
     anAddress parent: self.

We tried to provide some automatism in Aida for such back links in case 
the model doesn't have them, but this is not as easy as it look like, so 
Aida currently doesn't offer such help. Domain model should provide it.

> 2) How are images stored?  It looks like some images are stored in
> methods as binary data, but DefaultWebStyle>>headerElement seems to be
> using a filename ("/img/aidabannergif.gif').  What's the best way to
> add a new image?  By the way, I'm using Squeak with Aida 6.0 beta1.

Static content like images can be stored in two ways:

1. as files on the directory, reachable from home directory (by
    default is ./, that is where the image started from),
2. directly in methods (so called method resources/method images),
    You put suc method in your subclass of WebStyle, then by convention
    it got unique Url.

For instance (from latest dev version of Aida) :

	DefaultWebStyle #aidabannerJpg

become accessible on url:


But you simply call it in your code as:

	e addJpg: #aidabannerJpg.

Storing static content in methods has an advantage to be maintainable 
more easibly. You can use your SCM like Monticello to maintain it. It 
also ease the instalation of such app, all you need is just to load a 
proper package, without needing to install some separate .zip, 
downloadable form separate place, for a static content.

In Aida we have now all static content in method resources, exceptions 
is only a TinyMCE rich thext editor, which still needs to be installed 
separately in the home directory

> 3) Not a question, but a comment: in Step 4 of the tutorial, the class
> definitions of ADemoAddressBookApp and ADemoAddressApp are missing
> their superclass (WebApplication).  It took me a few minutes to figure
> that out; fortunately the previous paragraph mentions it.

Maintaining tutorials is usually harder that writing it. In this case 
Aida/Scribo eat superclass declaration, because on VisualWorks it is in 
brackets: {AIDA.WebApplication} and Scribo relatively recently start 
using such brackets for scriblets.

I now changed all class declarations to Squeak ones, which are simpler 
and without such brackets. Would you recheck please if class 
declarations are now right?

Thanks a lot for notifying that tutorial error. Who knows, how many 
others just turn away because of such error. Tutorial really need to be 
perfect and without such big bugs. So anyone detecting something wrong 
please report ASAP.

Best regards

Janko Mivšek
Smalltalk Web Application Server

More information about the Aida mailing list