create table salesperson sales_name varchar256, dept_no char2, primary key sales_name, foreign key dept_no references department on delete set null on update cascade; create table depa
Trang 1create table salesperson (sales_name varchar(256),
dept_no char(2), primary key (sales_name),
foreign key (dept_no) references department
on delete set null on update cascade);
create table department (dept_no char(2),
primary key (dept_no));
create table item (item_no char(6),
dept_no char(2), primary key (item_no),
foreign key (dept_no) references department
on delete set null on update cascade);
create table order_item_sales (order_no char(9),
item_no char(6), sales_name varchar(256) not null, primary key (order_no, item_no),
foreign key (order_no) references order
on delete cascade on update cascade,
foreign key (item_no) references item
on delete cascade on update cascade,
foreign key (sales_name) references salesperson
on delete cascade on update cascade);
create table order_dept_sales (order_no char(9),
dept_no char(2), sales_name varchar(256) not null, primary key (order_no, dept_no),
foreign key (order_no) references order
on delete cascade on update cascade,
foreign key (dept_no) references department
on delete cascade on update cascade,
foreign key (sales_name) references salesperson
on delete cascade on update cascade);
It is worth noting that with all the CASE tools we discuss here, the conversion of the logical design to the physical design is quite rudimen-tary These tools help create basic database objects, such as tables and, in some cases, indexes However, the advanced features of the database server are often not supported—where they are supported, the CASE tool
is usually behind by two or three software releases Developing advanced
Trang 2198 CHAPTER 9 CASE Tools for Logical Database Design
physical design features, such as multidimensional clustering or materi-alized views, is far beyond the capabilities of the logical design tools we are discussing Advanced physical database design is often highly depen-dant on data density and data access patterns One feature of Rational Data Architect that stands out is that it provides linkages with the auto-matic computing (self-managing) capabilities within DB2 to provide semi-automated selection of advanced physical design attributes
Figure 9.7 shows an example with ERwin schema generation, gener-ating the DB2 DDL directly from the ER model designed within ERwin Other very important capabilities shared by these tools include the ability to reverse-engineer existing databases (for which you may not have an existing ER or physical UML model), and the ability to automat-ically materialize the physical model or incremental changes of a model onto a real database This capability enables you to synchronize your database design with a real database as you make changes This capacity
Figure 9.7 ERwin schema generation for a DB2 database (picture from IBM: http:// www.redbooks.ibm.com/abstracts/redp3714.html?Open)
Trang 3is massively useful for incremental application and database develop-ment, as well as for incremental maintenance
9.5 Database Support
All of these products support a large array of database types Certainly, all of the major database vendors are supported by each of these prod-ucts (i.e., DB2 UDB, DB2 zOS, Informix IDS, Oracle, SQL Server), and a much larger set is supported through ODBC However, what really mat-ters most to the application developer is whether the database he or she
is programming toward is directly supported by the CASE design tool Database support is not equal between these products Also, very signifi-cantly, each database product will have unique features of its own (such
as reverse scan indexes, informational constraints, and so forth) which are not standard One of the qualitative attributes of a good database design tool is whether it distinguishes and supports the unique exten-sions of individual database products Each of the products has a strong history for doing so: in descending order, AllFusion ERwin Data Mod-eler, Sybase PowerDesigner, and Rational Data Architect Notably, IBM’s Rational Data Architect has a somewhat smaller range of supported bases than the other products, though it does support all the major data-base platforms However, Rational Data Architect can be expected over time to have the tightest integration with the DB2 and Informix fami-lies, since all of these products are developed by IBM Database designers
Figure 9.8 DBMS selection in AllFusion ERwin Data Modeler (picture from Computer Associates: http://iua.org.uk/conference/Autumn%202003/Ruth%20Wunderle.ppt#9)
Trang 4200 CHAPTER 9 CASE Tools for Logical Database Design
are advised to investigate the level of support provided by a CASE tool for the database being developed toward, to ensure the level of support
is adequate Figure 9.8 shows an example of database server selection with AllFusion ERwin Data Modeler
9.6 Collaborative Support
All three of these products are designed for collaborative development,
so that multiple developers can work together to design portions of a database design, either supporting different applications or collaborating
on the same portions These collaboration features fall into two domains:
1 Concurrency control This form of collaboration ensures that
multiple designers do not modify the same component of the database design at the same time This is comparable in software development terms to a source code control system
2 Merge and collaboration capabilities This form of
collabo-ration enables designers to combine designs or merge their latest changes into a larger design project These merging capabilities compare components between what is already logged into the
Figure 9.9 Merge process with PowerDesigner (courtesy of Sybase)
Trang 5project system and what a designer wishes to add or modify The CASE tools locate the conflicting changes and visually identify them for the designer, who can decide which changes should be kept, and which discarded in favor of the model currently defined
in the project
Figure 9.9 shows the Sybase PowerDesigner merge GUI, which iden-tifies significant changes between the existing schema and the new schema being merged In particular, notice how the merge tool has
iden-tified a change in Table_1 Column_1, which has changed base types The tool also found that Table_2 and Table_3, which exist in the
merg-ing design, were not present in the base design AllFusion ERwin Data Modeler and Rational Data Architect have similar capabilities for merg-ing design changes
9.7 Distributed Development
Distributed development has become a fact of life for large enterprise development teams, in which groups of developers collaborate from geographically diverse locations to develop a project The phenomenon
is not only true across floors of a building, or between sites in a city, but now across states, provinces, and even countries In fact, outsourcing of
software development has become a tour de force, with many analysts
projecting that the average enterprise will ultimately outsource 60% of application work, shifting aspects of project development to locations with cheaper labor As the META Group said in its September 16, 2004
Offshore Market Milieu report, “With global resources costing one-third to
one-fifth that of American employees—without accounting for hidden costs and having higher process discipline, offshore strategies now pervade North American IT organizations.”
Therefore, developers of database software working in a distributed collaborative environment need to consider the collaborative and dis-tributed qualities of CASE tools for database design The trend towards collaborative development and distributed development shows no sign
of slowing; rather, it is on the increase In the existing space, IBM’s Ratio-nal MultiSite software, shown in Figure 9.10, allows the best administra-tion across geographically diverse locaadministra-tions for replicating project soft-ware and data and subsequently merging the results Rational MultiSite
is a technology layered on top of Rational ClearCase and Rational