ObjectStore Rapid Database Development for Java

Chapter 1

Overview

This chapter introduces you to two new Rapid Database Development (RDD) tools: the Database Designer and the Component Wizard.

This tutorial is designed to give you hands-on experience with the Database Designer and Component Wizard. Try the exercises in the tutorial to see how quickly and easily you can develop applications using ObjectStore. The tutorial, which starts in Chapter 2, Design the Database, assumes that you have installed ObjectStore and these RDD tools.

In this chapter

This chapter covers the following topics:

Introducing the Database Designer

The Database Designer is a tool used for designing PSE Pro databases. It provides a graphical user interface (GUI) that lets you quickly create all the elements you need to represent your database design:

You can define database elements by simply clicking a button on the Database Designer toolbar.

For example, clicking the Class button opens the Class dialog box from which you can create a class, its fields, and methods.

The Database Designer provides support for both PSE Pro and primitive Java data types.

Design from the top down or bottom up

You can design your database using either the top-down or bottom-up approach. For example, you can quickly sketch a database design, populate it with only the classes you intend to implement, and then change the Database Designer default names as needed. You can create a class and later fill in the details such as fields, methods, and relationships. Or you can define each class in detail, one at a time, using property sheets in the Class dialog box.

Creating Relationships

You can easily create a relationship (one-way or inheritance) between classes.

To create a relationship between classes,

  1. Select the relationship type you want to create by clicking the corresponding button on the Database Designer toolbar.

  2. Press and hold the Shift key.

  3. Click and drag the mouse pointer from one class to the corresponding class you are creating the relationship with, and then release the mouse button.

The Database Designer opens a dialog box with default values for the relationship you created. You can accept the default values or you can define the relationship using actual names.

Viewing the Database Design

You can view the information in your database design in three ways:

Class hierarchy

The class hierarchy view displays a detailed view of all the elements in your database design.

This view is updated automatically whenever you make a change to the database design, such as adding a field to a class, creating a relationship, or changing a default name to one appropriate for your design. Color-coded symbols help you quickly identify different design elements.

Database diagram

The database diagram provides a higher-level view of the database design by showing which classes are related and how. Note that you can choose to display either of two styles of standard modeling notation - OMT (object modeling technique) or UML (unified modeling language). This tutorial uses UML notation.

Database diagrams can be printed and are useful for documenting your design. The design diagram is an effective way to convey database information to a nontechnical audience.

Element dialog boxes

Each class and relationship has an associated dialog box that contains detailed information. To view the relationship, double-click an element in the design diagram, or select Properties from the Class or Relationship menu bar.

The Class dialog box includes a separate property sheet for creating and maintaining each of the following database elements:

Introducing the Component Wizard

The Component Wizard is a code generator that uses the database design file you create with the Database Designer to generate ObjectStoreclasses.

You can launch the Component Wizard directly from Visual J++.

If you are using another Java compiler, you can start the Component Wizard from the Tools menu in the Database Designer.

You can select a database design and choose one or more classes, and then click Next to step through the creation process, or you can use the default values provided by the Component Wizard and then click Finish.

Generating Project Files

The Component Wizard automatically generates several types of files.

The following table describes some of the important files created by the Component Wizard.
File NameDescription
class.class

Class definition for every class in the database design. Class files also contain the code for the CRUD (create, read, update, and delete) functions associated with each class.

project.dsw

Workspace file, which bundles project and custom build dependencies (like a makefile for other makefiles). Generated only if you are using Visual J++.

doall.bat

A batch file that compiles the Java classes, calls the ObjectStorepostprocessor, and runs the application.

cfpagrs

Contains the parameters for the postprocessor.

extents.java

A wrapper around a container class that manages extents by automatically associating the container class with the proper root.

top.java

A Java class that contains the skeleton of a "main" function that you can use as a foundation for writing your ObjectStoreapplication.

Now that you have been introduced to the Database Designer and the Component Wizard, you can begin using these tools to design, write, and build your applications.



[previous] [next]

Copyright © 1998 Object Design, Inc. All rights reserved.

Updated: 10/06/98 15:36:29