When Xojo introduced the iOS framework when Xojo 2015 R1 came out we got introduced to the new Xojo framework. It was only required for iOS and were told that it would eventually get added to the other targets. Xojo 2015 R2 introduced much of the new Xojo framework into the desktop framework. Many people are curious if it’s time to start using the new framework. Is it safe to use?
Let’s get this clear up front. There is no reason why you have to use the new Xojo framework. Sure, it’s the future but the old framework will work for many years to come and there are huge gaps in the Xojo framework that haven’t been addressed yet.
My first bit of advice is to not dive headfirst into mixing and matching the old and new frameworks just yet. It can be an exercise is frustration. Take, for example, this bit of code:
dim d as new xojo.Core.Dictionary
d.value(kMachineName) = MachineName.ToText
if d.value(kMachineName) = “” then
Looks like it should work on desktop, right? It doesn’t because when you get to the comparison it generates an exception. When you break it down it makes sense because the Auto value you get from DictionaryValue is a Text type and you’re comparing it to a String type. The two are not equivalent.
The way around this, that seems to work, is to do this:
dim tBlank as Text
if d.value(kMachineName) = tBlank then
break //handle error
Obviously if I was using Text everywhere this wouldn’t be a problem. But this is a desktop app and the major gaps in the Xojo framework start to show up. The database classes will only accept Strings so you have to do some conversion. This isn’t a big deal, but it’s one more thing to worry about and deal with when exceptions come up.
99% of our consulting applications are database driven so not having the database classes in the new framework are a major hindrance to us to adopting the Xojo framework. Frankly, if it weren’t for the client wanting us to use the new framework whenever we can we’d not be using it yet.
Some of the parts of the Xojo framework that are done aren’t fully fleshed out. For the past couple of weeks I’ve been working with the xojo.net.httpsocket class. Works great on Mac OS X and Linux (surprisingly enough) but when I get into Windows for testing it just does nothing – no exceptions, no errors – it just absorbs commands. The first reports of issues happening in Windows were reported in back in August but that report was closed as not reproducible.
When it comes to the networking classes the new TCPSocket class still hasn’t been ported to non-iOS targets yet. Neither has any of the UDP and ITC classes and, in general, there are still a lot of old global framework classes that haven’t been ported yet.
This makes sense because iOS and then 64 bit took a lot of time and resources to get to the state they’re in today. I would argue iOS isn’t complete yet but that’s an argument for another day. It looks like 2015 R4 will be mostly Retina support so we are many months away from some of these gaps getting filled.
I am curious to hear other Xojo developers experience with using the new framework. For me it’s been frustrating from the lack of examples in the documentation, to it just working differently than the old framework, to the new classes not working as they should, to not having a complete framework to pull from and the messiness from commingling the old and new frameworks. My advice would be hold off on trying to use the new framework in a desktop, console, or web app until there’s more of it.
What’s your experience with the new framework?