REALBasic Terminology


Terminology used to describe programming languages varies by language. Although similar concepts exist in all object-oriented languages, they don't all share the same set of features and from time to time refer to things using different terminology or the same terminology with a slightly different meaning. REALbasic is no different. Before getting started, I want to provide a quick preview of the terminology I will be discussing throughout the rest of the chapter.

Programming code in REALbasic is organized and presented in a hierarchy. When you create an application in REALbasic, you start with a project. All the programming code that you write for the application is stored in this file. A project consists of a collection of modules and classes.

  • Project

    • Module

      • Constants

      • Properties

      • Methods

        • Subroutine

          • Programming code

        • Function

          • Programming code

    • Class

      • Constants

      • Properties

      • Events

        • Programming code

      • Menu handlers

        • Programming code

      • Methods

        • Subroutine

          • Programming code

        • Function

          • Programming code

In this list, you can see that a project is made up of modules and classes. Modules and classes represent two different approaches to programming: procedural and object-oriented. Although REALbasic is a modern, truly object-oriented programming language, it retains elements of procedural programming features when it makes sense in order to make the process of writing an application simpler and more streamlined.

REALbasic uses what is traditionally thought of as object-oriented terminology to describe modules. If we were purists, we would not say that modules have properties or methods. Instead, we would refer to them as global variables or subroutines and functions. Regardless, the folks at REALbasic have opted to use object-oriented terminology for all aspects of the language, so that's what I will do as well.

Classes and modules are made up of things such as constants, properties, and methods, and I will refer to them generically as members. A particular method implemented in a class is a member of that class, as is a property that has been declared for that class.

I said earlier that programs can either hold data or process data. Data can be held in memory as a constant or a property. Methods are where the data gets processed.

All the programming code you write will be written in a method. Methods come in two flavors: functions and subroutines. Functions and subroutines are composed of a series of statements, which serve as instructions to the program that tell it the kind of calculations to perform on data.

In addition to methods, classes implement events and menu handlers, which are basically methods with some special characteristics that will be discussed in the section on object-oriented programming.

The approach I take in this chapter is to start from the ground up. The first section covers the basic building blocks of a computer program, including things such as variables, constants, and methods. It concludes with an example of how to create a module in REALbasic. The second section will build on that basic information and provide a more complete discussion of object-oriented programming and how it is implemented in REALbasic.




REALbasic Cross-Platform Application Development
REALbasic Cross-Platform Application Development
ISBN: 0672328135
EAN: 2147483647
Year: 2004
Pages: 149

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net