Smallworld 5 Builds

Overview

Magik on java does not support magikc files any longer. You cannot create or read them (though reading them would be great for backward compatibility). Also the concept of images are no longer valid.

So how do you start a Smallworld session in 5.x? Well there is some documentation about it, but basic idea is that you start a registered magik session. This is defined typically in a register.magik file that is inside a module inside a config product. It is referenced from the gis_aliases file that you point to.

By "default" when you start the session, the magik code will be loaded based on what products/modules you have defined in the registered magik session. This is good for development, but is slow. And if you are a 3rd Party vendor, you would need to release the source code.

To speed things up, you can compile magik files into JARs. These typically are created when doing compile_all_modules() on the selected product. Also you can save the serialization information using save_serialised_module_definitions(0 on the product. One thing to note is that if JAR or SER files they take precedent over any changes to magik files. Just like an image, you would need to reload the magik files if there were any changes after the image was built. So for equivalency, the JAR/SER files can be thought of as the old image.

Details….

JARs are Locked

There is no out of the box redirection like the MSF files had. The JARs are locked when a Smallworld session is running. You must exit all sessions prior to rebuilding JAR files…

Creating JAR for a Specific module

Since Smallworld doesn't send the code and I couldn't get any timely info from the help desk or second line support, I poked around and developed the following code to compile one module to a JAR without needing to load all your modules in the product. This specifically helped me to compile several of the 172 modules I have as they were reviewed/fixed for Smallworld 5.

Method Finder Mapping

You can map the location of source files so that the method finder can jump to the appropriate code. This is especially good for when a JAR file is delivered but only certain source files are delivered in a separate directoey. You can use method_finder.add_mapping("NAME_OF_ENV").

Start Up Times

SW5 start up times are slow… What can be done to speed them up????

Theory 1

For those battling with start up times with Smallworld 5, here's an theory someone my want to investigate…

From my experiences, when the sw5 session starts, it basically does a build to load all the magik (in form of java class) code as it used to occur when you built images pre 5.

What would happen if you didn't load all the modules during session start up, but had a "loader" object that you could call that would load the module when something is executed the first time.

For example the case tool… Having available by default is good for developers, but when you do it will load the case modules during start up. Would it speed up things that when I start an application, the first thing it does is load the modules for that application if they haven't been loaded?

So the initial start up wouldn't load the case modules. only when you load the case tool would it load the case modules…

This could be expanded to other things also… Like the case data model objects… Only when you open a case SOC/SOM will it load the case object module…

Just some thoughts… I'm not doing stuff on SW5 right now, so I figure I would propose the idea and have someone else develop something if they have time…

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License