Page 546
Figure 20.12.
First window
displayed by Genera-
tion Wizard.
Figure 20.13.
Sending DDL
statements to a file.
At this point, you can click Finish to generate the SQL file. If no errors occurred, a dialog window will indicate that no processing errors occurred. On the progress meter, click Done to proceed (see Figure 20.15).
Page 547
Figure 20.14.
Specifying the
database objects to be
generated.
Figure 20.15.
Progress meter
displayed by Genera-
tion Wizard.
If you look on the Taskbar, you will see that Database Designer has opened the Notepad with the generated SQL file (see Listing 20.1).
Listing 20.1. SQL file generated by Generation Wizard.
-- C:\TYO\TYO.SQL -- -- Generated for Oracle 7 on 12/5/1997 17:47:07 by Oracle Database ÂDesigner v1.00 /* Source Diagram Details: * Name C:\TYO\TYO.ODD created 6/4/1997 18:55:25 * Last modified 11/5/1997 22:51:13 */ CREATE TABLE DEPARTMENT (DEPARTMENT_ID VARCHAR2(20) NOT NULL ,DESCRIPTION VARCHAR2(25) ); CREATE TABLE INSTRUCTOR (INSTRUCTOR_ID VARCHAR2(20) NOT NULL ,LAST_NAME VARCHAR2(25) NOT NULL
continues
Page 548
Listing 20.1. continued
,FIRST_NAME VARCHAR2(25) ,MI VARCHAR2(1) ,POSITION VARCHAR2(25) NOT NULL ,TELEPHONE VARCHAR2(10) ,FAX VARCHAR2(10) ,EMAIL VARCHAR2(100) ,DEPARTMENT_ID VARCHAR2(20) NOT NULL ); ALTER TABLE DEPARTMENT ADD CONSTRAINT DEPARTMENT_PK PRIMARY KEY (DEPARTMENT_ID) ; ALTER TABLE INSTRUCTOR ADD CONSTRAINT INSTRUCTOR_PK PRIMARY KEY (INSTRUCTOR_ID) ; ALTER TABLE INSTRUCTOR ADD CONSTRAINT DEPARTMENT_FK FOREIGN KEY (DEPARTMENT_ID) REFERENCES DEPARTMENT (DEPARTMENT_ID) ;
Database Designer will also reverse engineer a data model from several sourcesan SQL file containing DDL statements, an ODBC data source, or an Oracle database. The capability to reverse engineer a data model is sometimes necessary. As a developer, you may be provided with a legacy database without any accompanying documentation. By reverse engineering the legacy database, Database Designer can construct a diagram that will aid you in your understanding the legacy data model. You are then able to reengineer the modelperhaps adding additional entities and attributesby using the legacy data model as a baseline. Let's go through the steps that are needed to reverse engineer a data model from an SQL file.
Page 549
Figure 20.16.
Reverse Engineer
Wizard prompts for
the source to be used
to reverse engineer a
data model.
TIP |
As you can see in Figure 20.17, the Reverse Engineer Wizard will construct the objects based on the objects referenced in the SQL file. However, you may need to rearrange some of the objects; some of them may be overlapping, making it difficult to read the diagram. You may want to print the diagram to see all the objects and their relationships. |
Page 550
Figure 20.17.
Diagram constructed
by Reverse Engineer
Wizard.
The components of Designer/2000 can be grouped into these categories:
Let's discuss the role that some of these components play in the application-development process. To initially create a new application, you use the Repository Object Navigator and select File | New from the menu. A new application is created, which is named Flugle (see Figure 20.18).
Page 551
Figure 20.18.
Creating a new
application with the
Repository Object
Navigator.
Process Modeller is a tool that enables you to graphically describe the business processes that you are interested in modeling. Initially, Process Modeller is used to understand the processes as they currently exist. The tool is able to animate a process, making the dynamics more easily understood. From an understanding of the current processes, the processes can be redesigned to reduce cycle time or eliminate unnecessary steps.
Entity Relationship Diagrammer is similar to Database Designer but offers more features. Specifically, Entity Relationship Diagrammer distinguishes between the logical data modelcomposed of entities, attributes, domains, and relationshipsand the physical database designcomposed of tables, columns, views, constraints, and other objects. Like Database Designer, Entity Relationship Diagrammer enables the designer to graphically depict the data model. Like the other components of Designer/2000, Entity Relationship Diagrammer uses the Designer/2000 Repository for storing the data models for each application.
You use the Function Hierarchy Diagrammer to graphically describe the hierarchy of business functions performed by an organization. For example, at the highest level, you might describe a function named Manage Human Resources. Within that function, there are lower-level functions such as Recruit New Instructors, Hire New Instructors, and so on. With the