Chapter 7. The Architecture of an Application
The preceding chapters have explained how to write REALbasic code, and have discussed all the major components of a REALbasic project. The rest of learning REALbasic is just details about how to use particular built-in classes. Such details are the subject of Part II and Part III. Thatâs where youâll find answers to such questions as: What is a checkbox? How do I draw a picture in a window? How does REALbasic connect to the Internet? And so forth.
But one should also give some thought to the larger context in which those details are embeddedânamely, the structure and organization of your projectâs entire code. Details do you no good unless your application works. Properties, methods, lines of code are pointless unless you put them in the right place. The purpose of this chapter is to help you think about your applicationâs overall structure. The subject here is how to organize your code.
In a program written for a GUI-based operating system, thatâs no small consideration. The joy and the terror of such a program is that it isnât in charge; the user is. Your program canât predict what the user will do, so it must be prepared to react sensibly to whatever the user can do. Most of the time, your application sits idle, essentially asleep. Then, whenever the user presses a button, types in a field, chooses a menu item, dismisses a window, or performs any other significant action, an event arrives, and your application wakes ...
Get REALBasic: TDG, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.