Capítulo 2. Comenzando a trabajar
Para iniciarse en el uso de Power*Architect, comienza leyendo la sección llamada "Comprendiendo el interfaz de usuario de Power*Architect". Esta seccion te da una introducción rápida a las áreas principales de Power*Architect, El área de trabajo y el árbol de base de datos. Después, puedes querer pasar por la sección práctica llamada "Ejemplo - Creando un modelo de datos". Este ejemplo te muestra como crear un modelo de datos sencillo, establecer la conexión con la base de datos, y realizar ingeniería directa de tu modelo a la base de datos que prefieras.
Power*Architect contiene muchas funcionalidades, y puedes escoger hacer uso de alguna o de todas ellas, dependiendo de lo que quieras conseguir. Por favor, mira las secciones siguientes para un resumen de las actividades típicas que podrías realizar con Power*Architect.
- la sección llamada “Acerca de los Modelos de Datos”
- la sección llamada “Acerca del Análisis de la Estructura de Datos”
- la sección llamada “Copiar y Transformar Datos”
- la sección llamada “Acerca de las Funcionalidades Avanzadas”
- la sección llamada “Acerca de las Preferencias de Sistema”
Acerca de los Modelos de Datos
Por regla general, típicamente se siguen estos pasos para crear y utilizar un modelo de datos:
1. Crear un modelo utilizando el área de trabajo. Se puede hacer a partir de cero, realizando ingeniería inversa de una base de datos existente, o bien utilizando una combinación de ambos métodos.
Para más información, ver:
- Capítulo 3, Crear un Modelo de Datos
- Capítulo 6, Ingeniería Inversa de un Modelo de Datos
Para más información, ver:
- Capítulo 7, Ingeniería directa de un Modelo de Datos
- Capítulo 4, Configurando el soporte a Bases de Datos
Para más información, ver:
- La sección titulada “Utilizando Kettle Jobs”
Acerca del Análisis de la Estructura de Datos
Se pueden utilizar las numerosas funcionalidades de análisis de estructura de datos de Power*Architect para ver información acerca de una base de datos. Se puede:
- Comparar dos modelos de datos para ver las diferencias y similitudes. Generar y ejecutar un script SQL para actualizar una base de datos antigua de modo que se ajuste al nuevo modelo de datos
Para más información, ver:
• la sección titulada “Comparando Modelos de Datos”
- Ver un perfil de lo datos en una tabla de la base de datos.
Para más información, ver:
• la sección titulada “Realizando el perfilado de Datos”
- Crear un informe con una relación de las tablas originales utilizadas para las tablas del modelo de datos Power*Architect .
Para más información, ver:
• la sección titulada “Creando un Informe de Correlación Visual” - Exportar las correspondencias de columnas origen-destino entre una base de datos orgien y el Modelo de Datos Power*Architect.
Para mása información, ver:
• la sección titulada “Exportando Correspondencias de Columnas”
Copiando y Transformando Datos
Power*Architect proporciona dos modos (uno básico, el otro complejo) para copiar datos entre bases de datos.
Se puede:
• Copiar datos entre dos plataformas de base de datos para crear una copia exacta de una base de datos existente.
Para más información ver:
• la sección titulada “Copiando Datos entre Plataformas de Base de Datos”
• Crear transformaciones múltiples basadas en un Modelo de Datos.
Para más información, ver:
• la sección titulada “Usando Kettle Jobs”
Acerca de las funcionalidades avanzadas
Power*Architect contains a tool, called SQLRunner, that allows you to work at the raw SQL command
level. This feature should only be used by advanced users.
For more information, see:
• Chapter 10, SQLRunner
Acerca de las Preferencias de Sistema
You can set project and user preferences for Power*Architect.
For more information, see:
• Chapter 5, Setting Preferences
Comprendiendo el interfaz de usuario de Power*Architect
Each data model you create in Power*Architect is saved as a separate project. When you open a project, the
data model information is shown in Power*Architect's two main areas: the database tree and the playpen.
Acerca del Arbol de Base de Datos
The database tree contains a hierarchical view of your project. The hierarchy includes:
• The objects in your data model (tables, columns, keys, indices, etc.).
• The database connections you've added to the project.
• Any objects you've obtained through reverse engineering an existing database. You can drag these
objects into the playpen to add them to the data model you're building in Power*Architect. (Large objects
may take some time to load in the playpen.)
You can expand the branches in the tree to view objects and can often right-click an object to perform
actions. The following icons are used in the database tree to identify the object type.
Database
Catalogue
Schema
Owner
Table
Column
Primary Key
Exported Key
Imported Key
Index
Unique Index
Acerca del Area de Trabajo
The playpen is your main work area in Power*Architect, where you create and modify your data model.
You can use the playpen to experiment and manipulate tables and relationships. Your changes are not
saved until you decide to save them.
Your data model can includes tables, columns, indices, and relationships. You can create these objects
in Power*Architect or obtain them by reverse engineering an existing database. For more information on
working in the playpen, see Chapter 3, Creating a Data Model .
Utilizando Power*Architect en distintos Sistemas Operativos
Power*Architect supports multiple operating systems, such as Windows, Macintosh and Linux.
Power*Architect works the same on all operating systems, with a few minor exceptions:
• On Windows and Linux, CTRL is used as the accelerator key. On Macintosh, CMD is the accelerator
key.
• On Windows and Linux, the Power*Architect menu bar is shown below the Power*Architect title bar.
On Macintosh, the menu bar is shown at the top of the Power*Architect window.
Ejemplo - Creando un Modelo de Datos
This section will show you how to set up a simple database "from scratch", just to get you started using
the tools, without modifying any live data. If you follow the example literally, you will create a trivial
"customer and orders database".
Important: You must create the target database needed in this example. You can use standard vendorspecific
database tools to create the database.
Configurando Bases de Datos
1. Setup Driver. Select File->User Preferences and select the JDBC Drivers tab. Select the database
connection type you wish to use from the list on the left. If there is already a driver for the connection
type you wish to use, click OK and go on to the next step. Otherwise, click the Add button, navigate
to where you have the driver Jar file installed, and click OK.
2. Create a Connection. In the Database Tree section of the main window, right click and choose Add
Source Connection->New Connection. For this example you can use a name like SampleDB, for both
the Connection Name and the Database name (these names do not have to be the same, but we'll keep
them the same for simplicity). If you select the JDBC Driver before you type the database name, then
as you type the Database name, it will be added to the DB URL, so you don't have to type it an extra
time. Fill in all the fields and click OK.
Diseñando una Base de Datos
You are now ready to design some tables. For this example, we will create the Customer and Orders table
shown here.
1. Click the New Table icon at the right side. The cursor will change to a crosshair. Move the cursor near
the left of the Playpen area, and click. A "New Table" will appear.
2. Double-click the title, and the Table Properties Dialog will appear. Rename this table to Customers.
3. Click the Insert Column icon, and a "New Column" will appear. When the new column is created a
property window will appear for it. Rename the column to customer_id and make it part of the primary
key.
4. Insert additional columns for Firstname, Lastname, Address, City, Province, Country Code 1 and PostalCode. The table should look something like the following:
5. Create a second table, and name it Orders.
6. Create columns named order_id (in the primary key), Quantity, Total Amount, and customer_id. Your
project should now look something like the following:
7. We need a relationship between these tables. An order should have a foreign key that refers to the
customer. Click the "New Non-Identifying Relationship" icon. Select the Customers table, then the
Orders table, and a link will be drawn as shown. Click this link and the keys that take part in the
relationship will be highlighted in red.
Ingeniería Directa
1. If you're happy with the database layout (you can always change it later), it's time to create the database.
Click on the Forward Engineer button. You should see a window similar to the following:
2. Set the "Create in" database to be the source connection we defined earlier. Set the database type to be
the type that was set in the user preferences. Fill in the remaining fields based on the database type that
was selected and press ok. You should see a window similar to:
3. If this looks plausible, click Execute, and the tables and their relationship will be created.
Congratulations! You have now created a simple database using the visual tools in Power*Architect.
Comparando Modelos de Datos
Suppose that after using this database, you realize that there should be a "shipping amount" field in the
Order table (we never promised this would be completely realistic example).
1. Select the Order table by clicking on its title.
2. Click the Insert Column field and, as before, rename the New Column, this time to Shipping_Amount.
Change its type to Decimal(10,2).
3. Now we need to compare two different Data Models, the original database and the current project. Click
the Compare DM icon. Set the "Older" to Physical Database SampleDB (you may need to change the
Schema to Public). Set the "Newer" to "Current Project" (since it is now newer than the database you
created in Step 6). Set the output format to SQL.
4. Click Start. You should see the SQL Preview window again, but this time with just an ADD for the
column you just added:
5. Click Execute, and the new column will be added to your database table.
When you exit the program, it will ask to save your project. Since you might want to alter this in future,
to experiment with some of the other tools without damaging any live data, you may wish to save the
Project file.
The remainder of this document provides a more comprehensive explanation of the various functions that
Power*Architect offers.




