Code generators
Volume Number: | | 5
|
Issue Number: | | 9
|
Column Tag: | | Kelly's Corner
|
AppMaker and Prototyper
By Dave Kelly, MacTutor Editorial Board
AppMaker vs. Prototyper
Who says that writing Macintosh applications is difficult? Prototyper from SmethersBarnes has been available for quite awhile with virtually no competition. A new contender for the Mac applications development market is now available. Perhaps many of you have seen the advertisements for AppMaker by Bowers Development Corporation and Prototyper within the pages of MacTutor and wondered what the differences are between the two of them. Ive now had a chance to use both of them and hope to summarize my opinions within this column.
Traditionally, Macintosh development has involved creating resources for menus, windows, icons etc. which are used by the application. One of the greatest of all the developer tools that Apple has given us is ResEdit which gives us access to the resources and a way to edit most of them. Many programmers have developed their own libraries of functions and procedures including the basic shell which becomes a starting point for the development process. The major drawback of this is the amount of time required to organize and define all of these resources and routines into a working application. MacTutor has tried to help you understand the workings of the Macintosh to assist you in this development process.
Lets take a comparative look at the way that Prototyper and AppMaker helps you to develop your product. Each one does a good job, but the implementation is different. You may want to refer to MacTutor Vol. 4 No. 8 (or pg. 432 in The Definitive MacTutor) for my first comments about Prototyper. It has been significantly improved since version 1.0 which was reviewed therein. My major complaints have been remedied... C code generation and hierarchical menus. Both Prototyper and AppMaker create the shell of your application for you and allow you to draw the user interface for each window, dialog, alert, or menu. Depending on the scope of your application one or the other (or both) of them are ideal ways to get started with your development project. For the following discussion, please assume that we have planned out what menus and windows etc. we will need in our application.
Using Prototyper
The tutorial for Prototyper is very good, but to give you an idea of what it takes to develop an application Ill briefly review some of the features of Prototyper. You may want to refer to my comparison chart from time to time to see what differences there are between AppMaker and Prototyper. Prototyper presents you with three icons which allow you to define menus, windows or demo windows. Ill explain what demo windows are in a moment.
First we will define our windows; windows dont have to be defined first, but Ill start with them first anyway. Clicking on the window icon opens up a dialog which allows you to select which type of window, dialog, or alert you wish to use. Next the window opens and you have a palette of tools to use to create buttons, text fields, scroll bars and other controls. The comparison chart shows which tools are available for the customizing the layout of the screen. Window types may even be changed after the layout process has begun, but some items may be lost if not supported by the type of window selected. The location of the window may be adjusted on the screen in a manner similar to that used in ResEdit where the window can be re-sized and moved to the desired position.
Clicking on the menu icon brings up the menu dialog which allows editing of a single menu bar (only one menu bar may be used). A new Prototyper document includes a default Apple, File and Edit menu. Clicking the Hierarchical button in the menu editor dialog will enable the currently selected menu item to have one single level of hierarchical menus. For most applications this is enough, however this is a limitation with Prototyper.
The demo window icon sets up a window which either reads a text file or displays a Picture in a window for simulation purposes only. The text file needs to be in the same folder as Prototyper or it may not remember where the file is and do nothing. The Pictures must be pasted into the window (you cant load the picture from a file). Demo windows are ONLY useful when using Prototyper to simulate (as a prototype) how an application will work. Code is not generated to support the action of the window.
After the windows have been created and the menu defined, you can go back through and link the controls and menus so that the prototype will look and feel like the application you want. You may link menu items, buttons, or whatever to other menu items, buttons, windows, or whatever. For example you may have a menu item linked to open a window and another menu item linked to close the window. You may also link to commonly used Macintosh dialogs. The problem is that only part of the simulation is generated as code. For example you may link the Page Setup menu item to the actual Page Setup dialog and the Print menu item to the Print dialog. However, when the code is generated, the Page Setup dialog code is not generated (what a shame, so close). The standard GetFile and PutFile dialogs are also simulated when running as a prototype, but no code is generated. It seems that this could have been added easily especially since they give you the source code in the manual to use the SFGetFile/SFPutFile procedures.
The Prototyper manual contains a tutorial and explanation of prototyping your application. A brief explanation of the code generated by Prototyper is given and some tips on how to add your own routines to the source code. Modifying source code can be time consuming until you are familiar with the implementation of the code.
Using AppMaker
The main difference between Prototyper and AppMaker is that Prototyper allows the prototype to be simulated before the code is generated. Creating dialogs, windows, and alerts is much the same except that the AppMaker has a couple of tools that are different from Prototyper. For example AppMaker may use controls which are stored in a resource and user defined items. These items could always be added with ResEdit for Prototyper anyway.
To use AppMaker you select what you want to edit (Menu, Window, Dialog, or Alert) from a menu. The items which already exist show up in a list window similar to the list of items that Prototyper displays except that only menus show up when the menu item is selected, only windows show up when the window item is selected, etc. A unique feature of the window tools is the Palette tool. With this you may use a picture as a palette in the application similar to the palette found in MacPaint or other paint programs. The picture is split into several columns and rows which become the palette in the application.
The menu editor looks like a Mac screen with a menu bar at the top. The default menu has Apple, File, and Edit menus already created. It is very important to note here that each menu must include an ID name in order to be linked properly. For example, the Apple menu must have the name Apple in order to link properly. This is created automatically for you, but if you deleted a name by mistake, you might not be able to figure out why the code was not generated properly. At least you can know that something is missing when you try to compile the application and get an error. Hierarchical menus are linked to each other by their resource names also. If you type a menu item title that is the same as a menu resource name, the Hierarchical structure is automatically linked up when you create your code.
Windows, Dialogs, and Alerts are linked with resource names also, however, you dont have as much control over linking menu items to windows as you do in Prototyper. The good thing about it is that because there are fewer specific definitions, the code is more generic and possibly easier to modify. With either Prototyper or AppMaker you will need to modify and add to the code that is generated. With AppMaker you may even modify the AppMaker code so that it will add the modified code when application code is generated. Prototyper doesnt allow you to pre-modify the code before the source code is generated. Included with the AppMaker application are libraries for all the supported languages which are used to support the code which AppMaker generates.
AppMaker generates code that is Multifinder Aware. Multifinder Aware means that WaitNextEvent is used instead of GetNextEvent, therefore the application understands suspend and resume events. A SIZE resource is included so that Multifinder will know how much memory to allocate to the application. Multifinder Aware applications will be sent null events when they are running in the background so that they may perform background processing.
The AppMaker manual is a 114 page spiral bound book with a tutorial and full explanation of all AppMaker source code and libraries. The explanation of the libraries is a great help in modifying or adding to the source code.
The Verdict
Whether to use Prototyper or AppMaker is a personal decision. I think that both of them have advantages. I prefer Prototyper for its ability to try out an application before it is written, but I prefer AppMaker for its unique features that Prototyper does not have such as Multifinder Awareness and the ability to create multiple menu bars. Its a tie. Both of these applications get high marks for what they do.
Prototyper 2.1
SmethersBarnes
P. O. Box 639, Dept. 400
Portland, Oregon 97207
1-800-237-3611
Upgrades to registered 1.0 users are $49.
Price: $249
Pros: Ability to prototype application without compiling. Creates Pascal and C source code.NO COPY PROTECTION.
Cons: Does not link Page Setup, Print or SFGetFile/SFPutFile routines. Cant create more than one menu bar per file. Only one level of Hierarchical menus. Simple additions to source code is easy, but is somewhat difficult to change structure.
AppMaker 1.0
Bowers Development
P. O. Box 9
Lincoln Center, MA. 01773
617-259-8428
Price: $295
Pros: Creates Pascal and C source code. Applications created are Multifinder Aware. Resource IDs and names are user modifiable. NO COPY PROTECTION.
Cons: No prototyping capability. Does not link Page Setup or Print routines.