Skip to content

Year: 2016

Design Patterns in Xojo: Observer, Part 1

In a previous post we saw how to implement the Singleton Design Pattern in our Xojo apps. Now, it is time to look at another useful Design Pattern you can use in your apps: the Observer Design Pattern. This one solves the kind of question “How can the ‘x’ controls be automatically notified every time there are changes on ‘y’?” Sound interesting? Let’s see how!

Faro.jpg

In fact, this is the first of a two part series regarding the Observer Design Pattern. This one will focus on how easy is to implement using the interfaces already available in Xojo for UI controls like the PushButton, the BevelButton, and also for the Timer class. In Part 2, we will see how to implement the Observer Design Pattern from scratch, using our own Classes and Interfaces, so it will be easier to understand the mechanisms behind this Pattern and how to use it.

Comments closed

Design Patterns in Xojo: Singleton

One of the best things that Xojo offers to programming newcomers is that they can simply jump-in and start to write code. In a matter of a few hours they’ll have a functional app! Nothing new here. (Or for not-so-newcomers, a fast way of creating a functional prototype from a idea).

CandyMachine.pngBut as these users advance in their Xojo skills, they probably will care about coding better and to embrace the OOP way of doing things. After all, Xojo is a modern programming language with Classes, Inheritance, Interfaces and a bunch of the usual OOP paradigms that have much to offer: reusability, better maintainability and a lot of flexibility.

Comments closed

Methods Overloading: Computed Properties, Setters and Getters

Some years ago, Xojo introduced the ability to use Computed Properties, something that is present in other programming languages too and is based on the use of dedicated methods to assign and retrieve the property value itself. So, in other programming languages, the first of these dedicated methods (or functions), the Setter, is the one invoked every time we want to modify the value of the associated property, while the Getter method is the one used from our code to retrieve the associated value. The Object-Oriented Programming (OOP) concept found behind this feature is Method Overloading. Nevertheless, let’s make clear that Xojo Computed Properties are not methods. They aren’t! But they make our life as developers much easier compared with regular Properties.

Comments closed

Windows App Requirements

Microsoft refactored their core app runtimes in 2015. They have made what they call a “Universal C Runtime” which has been distributed via Windows Update to all supported versions of Windows that stay up-to-date (which is the default behavior for Windows Update).

Starting with Xojo 2016r1, the Xojo Windows framework has been updated to use the latest Microsoft tools. This allows Xojo to stay up to date and allows the Windows support to be improved in future releases. This means that Xojo itself now uses the new Universal Runtime and your built apps now require it.

Comments closed