Monday 7 April 2008

VB Space API 0.1 Is Released



I have released the first version of the VB API as a Pre-Alfa under OpenSpace.org. The main purpose of this early release is to gather feedback from prospective users, and build-up a proper roadmap. The backlog is filling up with stuff such as install program, batch operations, notification, and additional space functionality, and I'd appreciate your input and rating as to those or other items.

The release includes a nice little Excel file as an example, where you can interact with the space to write and read Person objects. The Excel file includes comments which explain how the example should be used, whereas the code, being very simple and self-explanatory, does not require extra elaboration in my opinion. Follow the
installation and example instructions and give it a try. Comments are welcomed!

Technical background and limitations – The VB API uses GigaSpaces C# API over COM. This means that I have a C# class which wraps GigaSpaces' C# API, and is exposed as a COM class. From this point onwards, the VB application communicates with my C# layer using COM.

There is a number of VB / COM limitations which I had to work around. I am still looking for ways to overcome these issues. One of the things you will note is that the Read API takes two arguments: a template, and a default value (there is an overloaded Read which also takes a blocking timeout as a parameter):






This is because VB over COM does not allow you (or I haven’t yet found the proper way) to return a null value from the C# layer and set it to the Response object, nor did I find a way to cast COM's return value. So when there is no result back for the template match in the space, I could not simply return null. I am looking at generics support for VB / COM, in which case the problem is solved as I can do something like: return default(T);

Another limitation I found is the inability to specify a VB class as serializable, which means that you need to declare your business classes using C#. It's a fairly quick and straight forward task, though I am still googling for a proper solution which will allow users to stay in the VB environment from start to end. If that proves to be impossible I can think of means such as generators to ease this process.

In next posts I will demonstrate how to create a full example from scratch.

-Guy

1 comment:

Anonymous said...

Nice Guy - looking forward to having a look at this - Jim