PUM – Starting with a new stone

PUM based development means API-based development. You – as the developer – define a model and an API to change the persistent data on your Gemstone/S server.

From that model and API, PUM generates source code (actually a TOPAZ shell script) for Gemstone to have this model within Gemstone/S and partial code fragments for your API calls – all handled by REST calls into the Gemstone Server.

I actually do my development with Gemstone/S 3.3.1 – so the stuff I describe here is tested against this environment – running under Ubuntu LTS 16.04. I also use GsDevKit_home from Dale Henrichs. These are my runtime requirements.

One creates a new stone and then adds some additional libraries from GsDevKit to build a foundation for an appliation (mainly the communication part). The following code sequence shows the needed packages:

...
%
doit
GsDeployer deploy: [
  Metacello new
    baseline: 'ZincHTTPComponents';
    repository: 'github://GsDevKit/zinc:gs_master/repository';
    onLock: [:ex | ex honor ];
    load: 'REST' ].
%
doit
GsDeployer deploy: [
  Metacello new
    baseline: 'ZincHTTPComponents';
    repository: 'github://GsDevKit/zinc:gs_master/repository';
    onLock: [:ex | ex honor ];
    load: 'Zinc-WebSocket-Core' ].
%
doit
ZnConstants 
  defaultMaximumEntitySize: (8 * 1024 * 1024) ; 
  maximumEntitySize: (8 * 1024 * 1024).
%
...

The last lines are only added to maximize the file size a REST request may be.

The next part is needed to load my runtime files (general support packages (REST, Swagger), communication classes (ZeroMQ), model runtime etc).

...
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'Neo-JSON-Core' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKPlatformExtension' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSK-ModelBaseRuntime' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKJSONSchemaSupport' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKZeroMQBase' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKZeroMQGemstone' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKZeroMQWrapper' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKRESTSupport' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKSwaggerSupport' ;
   load.
%
doit
Gofer new
   url: 'http://www.schrievkrom.de/extfiles/public-smalltalk/gemstone' ;
   package: 'MSKExtensions' ;
   load.
%
...

The “Neo-JSON-Core” is my own version. I had problems with the official version and never had time to work it out … that is still work to do. You do not need ZeroMQ stuff to make it all work – but ZeroMQ plays an important role in the general communication failities of the programming model.

Now you have a stone with a fully suitable runtime environment for PUM development. In the next posting I want to define a simple model and simple API calls.

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