FoxPro Developer's Conference '94
The 1 Hour Application
Andrew Ross MacNeill
PC Edge Inc.
(with assistance from Alan Schwartz, MicroMega Systems)
When designing this session, we tried to weigh the benefits and problems with using tools such as FoxExpress and Foxfire! to create an application. Obviously, without these tools, it would have been impossible for us to build the application we are going to build. However, the techniques and guidelines we suggest here apply to any kind of application building methodology.
We also tried to cover as many parts of a complete application as possible. In many places, FoxPro 2.6 offers wizards to provide solutions for custom applications. We have tried to identified the best ways of getting the job done with the least amount of work. When these solutions are offered by shareware or public domain utilities, we use them and provide them on the source code diskette.
The only two commercial applications we will be using in building the application are FoxExpress and Foxfire! Everything else is supplied either with FoxPro 2.6 or on the source code diskette.
Application Building: Methods
When building an application, there are three ways to approach the task:
An application generator such as FoxExpress automates a great many of the tasks involved in building an application. It usually falls short on the customization side where the learning curve takes a quick upswing.
While this is probably one of the most popular ways of application building, its also one of the most difficult. There are hundreds of tools available for the FoxPro developer to use, including tools provided with FoxPro itself.
The best solution is to take the best of all worlds: the basics from an application generator, the tools from other developers and the custom solution you build yourself. The learning curve to this approach does not need to be as difficult as it may initially seem.
Components of an Application
Before we build the actual application, lets identify the major components of an application.
Information is usually table-based. Tables are where the information is stored and manipulated.
Interface can be used to describe almost every aspect of an application. In this case, well focus primarily on the screen interface. Obviously this is an important part of an application and one where we dont want to overlook a lot of possibilities.
Access is how we allow the user to gain access to the screens. In the event-driven application we will be building, menus are the key. Unfortunately, FoxPro only provides one kind of menu builder and no samples beyond Quick Menu. Well discuss the possibilities available with tools such as FoxExpress.
Output is what the client is always after. FoxPro offers a fairly useful report builder to create the report formats but output also entails how the user displays information in that format.
Internals are the last part of the application well discuss. These are the components that clients often take for granted but cost us, as developers, the most amount of grief. Thankfully there are some tools that are available that can aid us in this process.
Building tables in FoxPro isnt difficult; a simple MODIFY STRUCTURE allows us to modify and add new fields to contain new pieces of information in the various formats (character, numeric, etc.). But from an application point of view, what the fields contain is far more important than how they contain it.
Data Dictionaries provide this missing link in FoxPro. Even in their most basic state, providing field descriptions for the tables, they can still provide valuable information, such as field concordance tables. In an application generator, data dictionaries provide far more than simple descriptions. They can provide picture formatting, index information, validation clauses all within the dictionary itself. This can allow us to manipulate information in the tables using the rules defined in the data dictionary.
Because FoxPro doesnt maintain an internal dictionary, a data dictionary cannot be automatically maintained by an application. However, it is possible to build your own tools that make this maintenance transparent to building the application.
Data Dictionaries also serve one other valuable purpose: documentation. With a single report, you can identify all of the structures of your application, complete with descriptions. This can be very useful when hiring additional consultants.
Before we discuss the benefits of Wizards and application generators, lets make one general rule:
USE THE SCREEN BUILDER FOR DESIGNING SCREENS!
If you dont, not only are you are spending your own valuable time doing mundane programming, you are doing your clients a disservice. Four years ago, screens had to be programmed in order to be truly useful. This is no longer the case.
FoxPro 2.6 introduced a Screen Wizard that makes it very easy to build a fully functional screen, although without internal validation. Logical fields automatically get check boxes, memo fields are placed into Edit regions and more. Application Generators can help you out even further by building in all of the rules contained in the data dictionaries, including lookups and more.
Microsoft has always ignored Menus as a major component of an application. This is very noticeable in that FoxPro 2.6 has Wizards for just about everything except menus. This is unfortunate because menus are the way in which screens and reports are all accessed. Menus have the power to make a complex application simple or a simple application hopelessly complex.
In truth, there isnt a lot to be done with menus. If you use FoxPros Quick Menu, you can duplicate FoxPros menu structure but the best items are missing, such as the Browse menu. As well, the FoxPro Menu Builder always creates similar looking menus and while you can use GENMENUX to make changes to this look, you should try to keep the menu structure simple.
Application Generators offer us some distinct advantages in this area. They can provide sample menu structures with built in options, such as About... and Indexing options. But they always use an important rule, standardize.
If youre not using an application generator, create some standard menu options such as a Help menu and append them to your application menus. Youre not only cutting down your own time, youre making it easier to introduce another application to a client.
FoxPro 2.6s Report Wizard is a very cool tool. It has an impressive array of reporting formats, everything from standard line reports to grouping and more. But creating output is not just building report formats, it involves retrieving the filtering the information to be shown.
The best tool to provide this type of functionality so far is Foxfire!
Foxfire! is popular enough that most data dictionary and application generators provide a translation tool for it. The data dictionary in Foxfire! is extensive and the interface is one that can be used by developers and end-users alike.
Using everything weve discussed up until now, we can build a very useful single-user application but theres quite a bit missing from a truly functional system. Multiple users may require multiple security levels. Even single users may need Help and/or documentation every now and then. And if you tell your clients to backup on a regular basis, the first question theyll ask is "How?"
There are some other issues that you may want to consider in an application. In Canada, bilingual systems is a federal government requirement. International applications may also have some kind of international requirements. When "right-sizing" an existing application or building a corporate-wide system, its not uncommon to find a need for importing and exporting information.
All of these issues are things that clients often take for granted. For developers, building these routines can often be expensive time-wise. Application generators can help out to a certain degree. As well, recently there have been some tools made available that can help in the building of these requirements in custom systems.
Levels of Security
Help & Documentation
The 1 Hour Application
(c)1994 PC Edge, Inc.