ERD UIspecs

UI Specifications for ERD Module


Posted By: Wessam Abd Rabo
Revision: 2.0
Date: 12.10.07 23:50:46
Updated on: 18.11.07 08:05:01


Development Team:
Wessam Abd Rabo
Nada El-Newehy
Ibrahim Foudah
Youmna Hussein
Aisha Khairat
Maha Shawki

Add your comments in the review page here

[[{TableOfContentsTitle=TableOfContents} | {TableOfContents title='Table of Contents'}]]

1.Introduction

1.1 Overview of Functionality


The Entity-Relationship Design Module provides a tool to bridge the gap between database design and the development of relational databases. The basic functionalities provided to the users of this module are:

  • Designing ER diagrams using drag-and-drop components
  • SQL DDL generation from an ERD
  • SQL DDL generation from database
  • Reverse Engineering an ERD into a relational db
  • ERD Generation from an existing relational db

1.2 Context


ERD is a netbeans module. It adds the previous functionlities to the IDE enabling the nb users to design, forward engineer, or reverse engineer databases supported by the IDE. Any nbProject can contain an ERD file. This way, the functionalities provided can be integreated within any nb application.

1.3 Basic Concepts


  • The Entity-Relationship Model is a high level model that is used for the design and visualization of database structures.
  • ER Models describe data as entities, attributes, and relationships
  • Entity: is what is equivalent to a table in a physical database
  • Attribute: characteristics of entities. Equivalent to column
  • Relationship: is what gets mapped to foreign keys in the physical database. There are multiple supported relationship types:
  1. Non-Identifying Relationship: regular relation between 2 independent entities. Usually one-to-many.
  2. Identifying Relationship: links a weak entity to a parent entity such that the weak entity cannot exist without the parent.
  3. Many-to-Many relationship: mapped as a new entity whose primary key is composed of the primary keys of the tables that are linked with this relation.
  4. Recursive relationship : an entity can be self-linked
  • Indexes: mapped to unique constraints and primary key constraints

2.Use Cases and Scenarios

ERD Module should support the following operations:

  • Creating new ERD Files
  • Generating ER Diagrams from a set of database tables
  • Generating a set of database tables from ER Diagrams
  • Generating SQL DDL from ER Diagrams
  • Generating SQL DDL from Databases
  • Printing ER Diagram to PDF
  • Export ER Diagram to JPG and PNG
  • Modeling ER Diagrams:

Adding Entities to ERDs
Deleting Entities
Copying Entities
Adding Attributes/Indexes to Entities
Removing Attributes/Indexes from Entities
Creating Relations(Identifying, non-identifying, recursive, many-to-many) between entities
Removing Relations
Editing Entity/Attribute/Index/Relations/Diagram Properties

  • Other operations include:

Collapsing/expanding entities
Zooming in/out
Resizing Entities
Moving Entities
Showing satellite view of ERD
Setting Diagram’s Layout (arrangement of entities on the diagram)

2.1 Main Use Cases and Scenarios


Creating a new ERD file

The user has just created a new project and wants to add a new ERD file to the project. This can be done for any Netbeans project type.
Scenario:

  • User selects project in Project Explorer and right-clicks the project’s node.
  • To start New File Wizard, user selects New->Other form the Contextual Menu above project.
  • In New File Wizard Step 1, user selects Other from Categories list and ERD File from the File type List
  • In New File Wizard Step 2, user specifies file name and location

Generating ER Diagram from a set of database table

User wants to visualize the structure of a set of database tables. He/she needs to connect to this database. He/she will have to create the database before hand; otherwise connection to the database fails. User can choose the database tables he/she wants to include in the generated ERD.
Scenario:

  • In Services Tab, under Databases node, user connects to a database
  • Right-clicks the connection node and selects "Generate E/R"
  • In Generate E/R Wizard, user selects the desired tables from the Available tables list
  • Clicks ADD to add selected tables to selected tables list and finish to generate the diagram

The user may want to have just a quick view of the database structure or the user can choose to save the diagram and add it to a project

Generating Database tables from ERD

User designed an ER Diagram. He/she created an empty database that will accommodate the generated tables. User wants to generate the set of database tables from the ER diagram.
Scenario:

  • User Clicks Generate DB button in Global Toolbar (build section)
  • In Generate Database Wizard, user provides Database name
  • Provides Connection attributes
  • Clicks Finish
  • In Services tab, user selects the database connection and clicks connect (refresh if already connected)
  • User expands the Tables node, under connection, to view the generated tables


2.2 Design Related Use Cases and Scenarios


Adding Entities to ER Diagram

User created a new ERD File and wants to start designing the diagram. He/she starts by adding a new Entity to the diagram editor.
Scenario:

  • User selects Entity component from Components Palette
  • Drags and drops selected entity on diagram's editor

Guide lines appear if entity is added so close to another component. It helps the user to position the entity at the right distance, at the right row/column.
The Newly Added Entity has a default name, has no attributes and no indexes added to it

Adding attributes to entities

User added an Entity to the ER diagram. He/she wants to add an attribute to this entity
Scenario:

  • User right-clicks the attributes area inside the entity
  • From the Attribute Popup Menu, user selects Insert Attribute

Name and datatype of the added attribute gets added in the attribute area inside the entity
Attributes get a default name(attr) and datatype(NUMBER) that can be edited by the user

Adding Indexes to entities

User added an Entity to the ER diagram. He/she wants to Insert an Index to this entity.In other words, user wants to add a unique constraint on one or more attributes of a given entity.
Scenario:

  • User right-clicks the indexes area inside the entity
  • From the Index Popup Menu, user selects Insert Index . Index Specificaiton Window pops up.
  • In Index Specification Window , user names the index
  • Chooses attributes that sepcifiy the index
  • Checks unique (if he wants the index to be unique)

Name of added index gets added in the Indexes area inside the entity

Removing Entities/Relations from ER Diagram

User added Entity or constructed a relation on the diagram. He/she wants to remove the entity/relation from design
Scenario:

  • User right-clicks the entity/relation to be deleted
  • From the Entity/Relation Popup Menu, user selects edit -> Delete

If the user tries to delete an entity, he/she gets the warning message "Unable to delete entity.Please Resolve dependencies" in case:

  1. Entity contains attribute(s) that is foreign key in other entities

Removing relations also removes attributes added as foreign keys in related entities Removing Entites that contain the foreign key is no problem and removes the relation as well

Deleting attribute/index from entity

User added an Entity and inserted attributes/indexes to it. He/she wants to remove an attribute/index from the entity Scenario:

  • User selects the attribute/index to be deleted
  • User right-clicks inside the attribute/index area of the entity
  • From the Attribute/index Popup Menu, user selects Delete Attribute/Index

If the attribute to be deleted is a foreign key in another entity, the warning message "Unable to delete attribute. Please Resolve Dependencies" is displayed to the user

Copying Entities on ER Diagrams

User added an entity to the ER diagram. He/she wants to copy this entity and paste it on another location in the diagram
Scenario:

  • User right-clicks the entity to be copied
  • From the Entity Popup Menu, user selects edit->copy
  • right clicks Diagram Editor, chooses edit->paste

The entity is copied with a new default name for example (entity 10)
After pasting the copy, the new entity will contain the same attributes and indexes but not relationships

Editing components properties

User wants to edit the properties of the diagram or components added to it (entity, relation,attribute, index)
Scenario:

  • User selects the component whose properties are to be edited
  • or right click the component and choose Properties from contextual menu above the component.
  • Edit properties in Properties Window

Creating Relationship between 2 entities

User added entities to the ER diagram and added at least 1 key attribute to each. He/she wants to add a relation ( (non identifying, recursive, or M-to-N ) between entities.
Scenario:

  • In Components Palette, user selects the type of relation
  • Clicks on one entity
  • Drags in the direction of the other entity
  • Drops it on the other entity (same entity in case of recursive)


2.3 Other Use Cases and Scenarios


Collapsing/Expanding entity

User designed an ER diagram. User is not interested to view details of the entity. He/she wants to view only the entity’s name. User chooses to have the entity at the Collapsed View. Later, user wants to view attributes and indexes of the collapsed entity. He/she chooses to have the entity at the Expanded View.
Scenario:

  • On the entity's title area, user clicks the arrow to collapse/expand the entity

To collapse/expand all entities on the diagram, user clicks Collapse All/Expand All in the View Toolbar

Zooming in/out Diagram

User designed an ER diagram. User wants to Zoom in/out to get a better view of the diagram’s components.
Scenario:

  • In Diagram Toolbar, user selects Zoom in/out
  • Or, scrolls up(zoom in) and down (zoom out) using the mouse

Showing Satellite view of ER Diagram

User designed or generated a large ER Diagram. He/she wants to get an overall, smaller scale view of the whole diagram.
Scenario:

  • In Diagram Toolbar, user selects Satellite View
  • Satellite view is displayed at the middle west side of the Diagram Editor

Setting Diagram’s layout

User designed ER Diagram. User wants to align the diagrams entities and relations in a certain arrangement. He/she wants to set a layout for the diagram
Scenario:

  • In Diagram Toolbar, user Selects layout
  • Or user clicks on diagram, go to diagram’s properties sheet, edits diagram layout

3. Specifications

3.1 Wizards


New File Wizard – Choose File Type (step1)

Figure: Project Categories and file types File:Step1-File Type.png Components:

  • {Description} – label that provides a description of what will happen if the user chooses ERD File from File Types

New File Wizard – Name and Location (step 2)

Figure: Name and Location of the ERD File File:Step2-Name And Location.png Error Conditions:

  • {w}- warning icon that appears if the user enters a name for the new ERD file that already exists

Generate ER-Diagram Wizard

Figure: Generate ERD wizard File:Generate DB.png

3.2 Menus


Entity Menu

Figure: Entity Menu File:EntityMenu_ERD_UIspecs.png

Attribute Menu

Figure: Attribute Menu File:Attr_Menu_ERD_UIspecs.png

Index Menu

Figure: Index Menu File:indexMenu_ERD_UIspecs.png

Relation Menu

Figure: Relation Menu File:RelationMenu_ERD_UIspecs.png


3.3 Toolbars


Diagram Toolbar

Figure: Diagram Toolbar File:DiagramToolbar_ERD_UIspecs.png

3.4 Windows


Main Window

Figure: placement of toolbars in the main menu File:Placement_ERD_UIspecs.png Components:

  • {DB}: Icon for Generate Database Button
  • {SQL}: Icon for Generate SQL Button
  • {V}: Icon for Validate Diagram Button

Components Palette

Figure: Components Palette File:ComponentsPalette_ERD_UIspecs.png Components:

  • {e}: Icon for Entity
  • {r}: Icon for Relationship
  • {i}: Icon for Index
  • {m}: Icon for Many-to-Many

Explorer View

Figure: Explorer View File:Explorer_ERD_UIspecs.png Components:

  • {d}: Icon for Diagram
  • {e}: Icon for Entity
  • {a}:Icon for Attribute
  • {t}:Icon for Attribute Datatype
  • {I}:Icon for Indexes Node
  • {p}:Icon for primary key Index
  • {i}: Icon for Index
  • {u}: Icon for a Unique Index
  • {r}: Icon for Relations Node
  • {fkn}: Icon for the Foreign key Name
  • {fk}: Icon for the Foreign Key Description


3.5 Properties Sheets


Entity Properties Sheet

Figure: entity properties sheet File:EntityProp_ERD_UIspecs.png

Attribute Properties Sheet

Figure: Attribute properties sheet File:AttrProp_ERD_UIspecs.png

Relationship Properties Sheet

Figure: Relationship properties sheet File:RelationProp_ERD_UIspecs.png

Index Properties Sheet

Figure: Index properties sheet File:IndexProp_ERD_UIspecs.png

Diagram Properties Sheet

Figure: Relationship properties sheet File:DiagramProp_ERD_UIspecs.png


3.6 Visual Components


New Entity

Figure: Default view of newly added entity File:Entity_Default_ERD_UIspecs.JPG

Entity- Collapsed

Figure: collapsed entity File:Collapsed enitty.JPG


Entity- Conceptual view

Figure: conceptual view of entities on the diagram File:Conceptual view.JPG


One-to-Many Relation

Figure: one-to-many non-identifying relation File:1-N Relation.JPG


Many-To-Many Relation

Figure: Many-To-Many Relation File:M-N Relation.JPG Components:

  • M-to-N relations are represented on the diagram as a new Entity with an identifying relation between it and the 2 entities that it's relating. This new entity's promary key is composed of the key of the 1st entity and the key of the 2nd.

Recursive Relation

Figure: recursive relation as appears on the ER diagram File:recursive_rel_ERD_UIspecs.JPG Components:

  • Recursive relation is created by dragging a relation component from the palette, clicking on the entity, and dragging and dropping the relation on the same entity
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo