PUM – Overall Application Structure

Sometimes its not clear, where PUM is targeting – a graphic may show this much better. In this graphics one can see the general application structure we have used with PUM and the other languages against Gemstone/S database in several projects so far.

The parts in dark blue are actually in production usage, Android and Java have been tested in small application and the practical tests for iPhone are still missing.

 

Marten

Posted in Smalltalk | Tagged , , , , , , , , , , , , | Leave a comment

PUM – Adding JavaDoc support

With the version today I added initial JavaDoc support in the generated source code.

Posted in Smalltalk | Tagged , , | Leave a comment

PUM – Updating VASmalltalk Generator

When looking around the generators I noticed, that I forgot to made several changes to the VASmalltalk generator (e.g. remove the needs for cookies).

Therefore the runtime had to be changed and I changed the created methods for VA to look them more like the ones I created for the mainstream languages.

 

Posted in Smalltalk | Tagged , | Leave a comment

PUM – Dolphin7 – just for fun

When working on PUM today I started by random Dolphin7 and looked around a bit and then decided to do initial work for a code generator.

Dolphin7 is quite a nice target, because it is Smalltalk and it can produce native Windows application.

The code generator I’ve written today so far creates the whole class structure in a pac-format file. There is a base pac-file holding the base runtime, but that’s it.

The problem with Dolphin7 here is the missing of several supported stuff:

  • json-support, datetime wih timezone

We will see, how difficult this can be …

Posted in Smalltalk | Tagged , , | Leave a comment

PUM – Adding C# as a supported language …

Another language added to PUM – though in an early state, but the first program has been coded on an Android device via C# and Xamarin and it got its result …

The language binding was mainly driven by the design of the Java binding I wrote last weekend – but due to the fact, that I focused now on Xamarin I decided to go to implement the binding by creation “Portable Class Libraries” under .NET.

That was a topic I’ve never done before … and it became quickly a miracle … The PCL based libraries are libraries based on available .Net code on the selected target platforms and the intersection of available methods and attributes can become very strange.

Looking for solutions in the Internet is more or less useless – most of these published solutions are based on the normal .Net 4.x and this has far more classes than available in the PCL platform.

But somehow I made my way to implement a http request and even got an answer from that. The biggest problem became the selection of a suitable json library – all libraries I tried did not work. Even the Newtonsoft.Json library (10.0 with various architectures) had problems with the various platforms and well I was nearly up to a point to leave this project, when I found an older Newtonsoft.Json 7.0 library at Xamarin and I used this one and it worked.

Due to the Xamarin way I only support the async-API … that means, that all calls are executed asynchronely to the program – this seems to come from the mobile platforms – and was introduced later in the desktop .Net 4.x system also.

Now I have to become familar to this new development platform, polish the libraries a little bit, try out iPhone and that stuff.

After Java and Xamarin/C# most of my “wished” languages are available under PUM in a more or less (:-)) stable way:

  • Java, C#, Python 3, Sencha ExtJS, Electron (ExtJS), VASmalltalk

That means, that from all these languages I can now access my Gemstone/S based API-oriented systems.

 

 

Posted in .NET, Smalltalk | Tagged , , , , , , , | Leave a comment

PUM – Adding Java to the supported languages

This weekend was a Java weekend. Never really worked before with that language, but a customer wanted a Java interface for our product, so I had to implement a Java-8 generator to PUM.

More or less three days were needed (including learning all that Java usual stuff). I decided to use gjson as the JSON support library and on Saturday the first test application could be coded and it worked – and lot of time was needed to persuade gjson to do its job.

The structure is pretty simple – one need a base runtime jar file offering the needed http support and json support. PUM generates the code for another jar file containing the model and the main ApiClass.

Still more work is needed to make exception handling more comfortable and add more documentation to the source code.

After that success I started to rewrite the C# generator part to remove all the swagger code I generated and needed and make the C# part actually a clone of the Java part in terms of the structure. Here I use Json.Net as the supported Json library.

The main idea behind that is to get a proof of concept, that we would be able to write apps for Android or iPhones – using the Xamarin framework now available with VisualStudio 2015.

 

 

Posted in Smalltalk | Tagged , , , | Leave a comment

Gemstone/S – A Dead Item in a SortedCollection – What the hell is going on …

In our main product – in progress of development – we had a situation, where items in a SortedCollection could not be removed. From time to time we had these instances and I was not very happy about them.

The instance of SortedCollection had a sort block like: [:a :b | a getDoubleValue < b getDoubleValue ] – that means, that the sorting is based on an attribute of those elements hold in that collection.

The reason why the elements could not be removed was pretty soon clear: the attribute values (which the sorting is based on) had changed and the rules are pretty clear: if you change an attribute which is used as the sorting attribute somewhere you should remove the item from the SortedCollection. Change the attribute value and add it again to the SortedCollection instance.

Actually I was surprised to see, that these errors never popped up with an exception, but the PUM generator generates “remove:ifAbsent:[]” in the Topaz based server source code statements, so this error has been catched. Actually the question remaining was: “Who changes this value ?”. The attribute value was a double value and it was never intended to change very often or at all.

The structure of the application we developed here was an API driven application. The Browser-Frontends call the API, send some data (via JSON) and change them. The exchange of the update-API calls were done in that way, that ALL attributes were send to the database – regardless if they have changed or not.

The values of the attribute values therefore were also send from the server to the client and back to the server again – and we found the error: Gemstone/S prepared the string representation of the double value and put that string into the JSON representation, which was sent to the client.

The cliented presented the data, the user did some changes and the values got back to the server – and from time to time, the string-presentation changed (the user had no chance to change this value) , when the client (Javascript float -> string) sent back the data to the server. Not always, but sometimes and NOT very much – perhaps only the last digit changed.

But for Gemstone/S the little change was enough – the item could not be removed from the SortedCollection again. One could trigger a resort, but with 500.000 elements in that Collection this is not a nice way to go …

Another way to get rid of this error was to mark this attribute in the PUM editor as “client-readonly” attribute, which generates code in the server in that way, that changes of that attributes are never transferred to the stored domain object from the API transfer object.

Posted in Smalltalk | Tagged , , | Leave a comment