Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 16.4 ('Mojave')
Instant purchase and download via GumRoad!


Refactoring a Controller Module, Part 1

Dividing the medication controller module

Issue: 16.4 (July/August 2018)
Author: JC Cruz
Article Description: n>No description availabl
Article Length (in bytes): 43,731
Starting Page Number: r>
Article Number: 16404
Resource File(s):

Download Icon project16404.zip Updated: 2018-07-02 22:39:13

Related Link(s): None

Excerpt of article text...

In my last three articles, I extolled the benefits of a model class. I explained how I designed two model classes: one for database data, the other for predicate data. I also showed how I incorporated those models into a controller module.

Now I turn my focus on the controller module. I have already modified one such module (namely, vitalsLib). But what if the controller module works with multiple database tables? What if it does more than just manage the data flow between views and models?

I shall describe the steps I took in this article.

Readers must have a working knowledge of Xojo, SQLite, and object-oriented design. The updated version of the demo project FooHealth (Mk13) is available from the magazine's website.

Planning The Update

When I updated the controller module vitalsLib, I made three key changes. I replaced its properties with instances of the ModelSQL class. I rewrote its entry methods to make use of instances of ModelPredicate and ModelSQL. And I removed those private methods made redundant by ModelSQL.

...End of Excerpt. Please purchase the magazine to read the full article.