The New Xojo Framework

Xojo, Inc. has talked a lot at XDC (Xojo Developers Conference) about their new upcoming framework.  The reasons for a new framework are many and valid.  Among them are consistency, a need to serve desktop, web, and soon to be iOS applications, and to remove archaic methods.

This sounds kind of scary because most of us have been using the existing framework for many years.  But in reality I don’t think this is a bad thing.  How many times have you been bitten by framework calls that are one-based rather than zero-based to name just a few.  The new framework promises to make everything consistent across the entire Xojo universe.  All arrays/lists will be zero-based and methods are more explicit in their naming.

Furthermore, UI controls will become portable between desktop, web, and iOS.  In the current framework a desktop button is not portable to web button and visa versa.  While this isn’t too horrible, it makes life a bit more difficult as you have to create new instances and then copy the code from the events from one to the other.  The new framework means that a button is a button is a button regardless of platform.  There will be SOME differences as there are some platform specific controls (iOS has views, splits, tab bar, etc) that have no equivalent on the other platforms.

The Xojo framework has several main modules:  Core, UI, iOS, String, Color, Number, Math, Media and a few others.  They’ve also added a number of common interface elements that I suspect will become a very big part of the framework.  The Core framework has common items like Dictionary, Point, Rect that will be used by other parts of the framework.  In today’s framework you would create a Dictionary object like:

dim d as new Dictionary

In Xojo it would become:

dim d as new xojo.core.dictionary

Not a huge difference but enough that I’m sure will tick some people off.  But what this gives you are new methods that are unique to the Xojo framework that are very useful like ValueOfKey and RemoveByKey.  Not that those do anything different than Value and Remove in the existing framework but they are more explicit in their use.

Strings are another change in that strings now are zero-based to become consistent across the entire Xojo universe.  But otherwise most functions are part of the Xojo.String module.  All the usual suspects are there but new functions that are more explicit are also available.

The new framework is a requirement for iOS.  When it ships it will NOT be able to use the old framework.  Shortly after the iOS release it will be released for Web and then shortly after that for desktop.

The good news is that the old framework and the new framework can be used simultaneously (exception iOS) for years to come so it probably won’t mean much to anyone for a while.  When I asked Xojo, Inc. when they’ll drop the legacy framework they really had no answer.  I suspect like many deprecated things from Real Studio it will take a while.  So there’s no need for panic.

The new framework should make life easier for all of us in the long run.  It’s not going to be a quick transition and we won’t be forced to use it.  I’m okay with it because I’m sure there will be a bunch of other things to worry about more.  Welcome to the future.