Friday, May 16, 2008

The Servoy 4.0 Experience - Part 4

Ok, ok, this is the last one. After digging into this Servoy 4.0 Public Pre-Release a bit more (over a nice bottle of wine) - I found some other cool stuff that I played around with andjust had to tell you about: form inheritance, form variables, and menubar plug-in.

Form inheritance is really cool and a huge time saver. Basically, it allows you to base a new form on any other existing form - so that you don't need to create many similar forms from scratch. It works like this: let's say you have a basic dialog form that has a text area and two buttons ("OK" and "Cancel") and you want to create another one that has a third button "Details".

In previous versions you'd have to duplicate the form, then go back and duplicate the method on the OK button, then duplicate the method on the Cancel button, then duplicate any other methods - and hook them up to all the objects, THEN add your new button and its method.

In 4.0 - when you create the form (or even after it's created!) - you can set the "extends" property to any other form. Servoy will then show all the objects on the form (locked with a red outline) and will keep all the methods attached to all objects and even all the form events hooked up to the original methods.

Now, here's the cool part - you can then overwrite the method that attached to any item with a new method (called "overloading" in geek speak). This allows you to quickly create lots of similar forms - and if you want to change something on all of them - you only have to change the base (original) form - and all the changes automatically appear in all the related forms.

Very cool!

Form variables are just what they say - variables that are scoped within a particular form - as opposed to "global" variables which are scoped within the entire solution. This is really a great feature. I can't tell you the number of times that I've created 10 or 15 global variables with the name of "text01", "text02", etc. so that I could use them at various places for specific form-based functions.

It's also handy in another situation: multiple instances of the SAME window. If I have Form_1 and open two copies of it - using global variables rather than form variables - if I changed the value in the global variable in the first window instance - it would change in the second instance as well.

Now, with form variables - both window instances have their own "copy" of all the form variables - so both window instances can act completely independently of each other.

Sweeeeeeeet!

And last, but by no means least, they've added a new menubar plug-in. Although available from the most-excellent Servoy plug-in vendor IT2Be for a couple of years - it's nice to see it bundled with the default installation.

The menubar plug-in allows you to - wait for it - take control over the menubar. You can add your own menus, change the default menus, add icons, hierarchical menus, disable/enable menu items, etc. But it goes farther than that.

You can add your own toolbars and place them inside windows, add contextual menus to any object and much more. Not everyone will want to monkey around with menus - so it's good that they made it a plug-in rather than just adding a bunch of overhead to the "application" object - for stuff only some people will use (isn't that why plug-in exist in the first place?).

Regardless - all these improvements (and I didn't even talk about rightClick and doubleClick events on labels and buttons!) really add up to a terrific release.

I didn't think it was possible to make Servoy any more productive - but in this case - I'm glad to say I was dead WRONG!

If you want to download the public preview (or the currently shipping 3.5 version for that matter) - just go to http://www.servoy.com/developer. They've also scheduled some MORE live webinar events next week - but you gotta' register for them at their events page.

No comments:

Web Analytics