VASmalltalk – Headless servers and IC’s

Another kind of deployment path of VASmalltalk – perhaps not so well known – is to deploy your application using IC’s. The way is described in the product documentation.

But actually now playing with the product over years I tried this way of deployment in the last two weeks for my first time.

The reason for this were the problems (or better: pain) I had with packaging libraries like Seaside – as discussed in the Instantiations forum at Google over the last two weeks.

All this is a new world for me and I was surprised to see, that Instantiations offers prebuild IC’s only for desktop applications, but not for headless applications. Indeed the documentation tells the user, that reduced image deployment should be the preferred way for headless applications.

While playing with IC’s I noticed, that the startup speed and/or the perhaps increased memory consumption is not really that problem today.

Software IC’s may help you decreasing the memory footprint, if you have several applications running at the same time, sharing their IC’s in shared memory. This scenario may happen in headless applications on a server and ICs offer you a way – though not that easy – to distribute patches to your running application.

In my situation the fact, that IC’s are parts – but not reduced – of a Smalltalk image I have not to consider all these packaging problems. I can be sure, that everything (classes, methods) is there.

Ok, my main target was the headless working under Windows and I started building several IC’s for the server side.

In my first attempt I created one large Smalltalk IC containing the base system (Kernel, Kernel Extension, Networking, SST, Javascript, Seaside and additional stuff), which size was several MB large and my small demo (which was only 7 KB large) and it worked🙂

Then over several days I tried different kind of partitioning of the base system. The more IC’s I build the more management problems I had – actually I have found, that only using a GUI oriented way of building an IC is good for the first start, but later one may need some kind of batched building system.

To give you an idea of the sizes of the IC’s:

* Base Kernel (3.3 MB)
* Kernel Extension (375 KB)
* Base Networking (155 KB)
* SST (0.85 MB)
* GreaseLayer (110 KB)
* Announcement (15 KB)
* Seaside (2.17 MB)

and my “Hello World” applications:

* MSKBaseComponent (6 KB)
* MSKSeasideExample (7 KB)
* MSKBaseComponentExtension (6 KB)

All these applications are placed in their own IC.

The demo Seaside example (defined in MSKSeasideExample) loads MSKBaseComponent IC and just says “Hello !” and places some button (“Load” and “Unload”) on that page and tells a third Seaside component (defined in MSKBaseComponent) to render itself on the rest of the page.

Because the third component is only defined in MSKBaseComponent – but has no rendering method there – the rest of the page is empty.

By clicking on Button “Load” on the demo page the Seaside code loads the third IC (containing the extension methods – and at last: the rendering method), the page gets rendered again an the now loaded render method is showing real content.

By clicking “Unload” the third IC is unloaded again by the Seaside demo and the page is rendered again and the rest of the page is empty again.

This entry was posted in Smalltalk and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s