Tuesday, January 11, 2022

Symbols from MySQL Entity Relationship Diagrams

Entitities

primary key primary key
optional foreign key optional foreign key
required foreign key required foreign key
optional attribute optional attribute
required attribute required attribute

Example Entity

An entity drawn by MySQL Workbench with a primary key, an optional foreign key, three required foreign keys, an optional attribute, and three required attributes.

An entity drawn by MySQL Workbench with a primary key, an optional foreign key, three required foreign keys, an optional attribute, and three required attributes.

Relationships

Relationship Ends

zero or one zero or one (optional)
one and only one one and only one (required)
zero or many zero or many (optional)
one or many one or many (required)

One-to-One Relationships

zero or one to zero or one zero or one (optional) to zero or one (optional)
one and only one to zero or one one and only one (required) to zero or one (optional)
zero or one to one and only one zero or one (optional) to one and only one (required)
one and only one to one and only one one and only one (required) to one and only one (required)

One-to-Many Relationships

zero or one to zero or many zero or one (optional) to zero or many (optional)
one and only one to zero or many one and only one (required) to zero or many (optional)
zero or one to one or many zero or one (optional) to one or many (required)
one and only one to one or many one and only one (required) to one or many (required)

Tuesday, November 11, 2014

Keyboard Shortcuts for Eclipse

A list of common keyboard shortcuts to use with the Eclipse integrated development environment

Move Caret

Home Move to beginning of current line
End Move to end of current line
Ctrl+Home Move to beginning of file
Ctrl+End Move to end of file
Ctrl+ Move one word to the left
Ctrl+ Move one word to the right

Select Text

Ctrl+a Select all text
Shift+move caret Select text

Edit Text

Ctrl+x Cut selected text
Ctrl+c Copy selected text
Ctrl+v Paste text
 
Ctrl+z Undo last action
Ctrl+y Redo last undone action
 
Ctrl+d Delete current line
Ctrl+f Open find and replace window
Ctrl+Space Open content assist window

Indention

Tab Increase indention of selected text
Shift+Tab Decrease indention of selected text
Ctrl+i Fix indention of selected text or current line

Comments

Ctrl+/ Comment or uncomment selected text or current line (adds or removes '//')
Ctrl+Shift+/ Add block comment around selected text (adds '/*…*/')
Ctrl+Shift+| Remove block comment

Run and Debug

Ctrl+F11 Save and run
F11 Debug
F5 Step into function
F6 Step over
F7 Step return
F8 Resume
Ctrl+F2 Terminate

Other

Ctrl+p Print current file
Ctrl+s Save current file

Java and JavaScript Support for Microsoft Visio

I often create unified modeling language (UML) diagrams to design and document computer programs and systems and to communicate with my students and clients. Because I use the UML diagrams to document and not just design, I want to be able to make changes to my diagrams and print them for many years after I first create them. On many occasions, I have spent substantial time creating a diagram using open source or other UML diagramming tools only to find that I cannot change or print the diagram one year later because the latest version of the diagramming tool that I used is not backwards compatible. This has caused me substantial rework and frustration.

Microsoft Visio is a powerful diagramming tool that includes support for UML 2.0 diagrams. It is a stable tool that is backwards compatible with previous versions and consistently produces professional looking diagrams. Quite simply, Visio works version after version, which is not true of many other UML diagramming tools. Unfortunately, Visio does not include support for Java or JavaScript. It does not include the native Java and JavaScript data types or any of their API classes and will not reverse engineer Java or JavaScript source code to create UML class or sequence diagrams. Also, Visio will not produce Java or JavaScript classes from UML class diagrams. In spite of it not being able to read or write Java and JavaScript code, I have adopted it exclusively for all of my UML diagrams because Visio always works.

Since I often write programs in Java and JavaScript, I have created two Visio files, JavaAPI.vsd and JavaScriptAPI.vsd, that contain Java and JavaScript primitive types and many of their API classes. Both files are far from complete, but they have saved me much work when creating new UML diagrams. If I need to design or document a small program, then I simply add the diagram to one of these files. If I need to design a large system and create many diagrams, then I make a copy of the file and create the diagrams in the copied file.

The Java API file contains many classes from the following Java packages

  • java.awt
  • java.awt.event
  • java.awt.image
  • java.io
  • java.lang
  • java.math
  • java.net
  • java.security
  • java.security.spec
  • java.sql
  • java.util
  • java.util.zip
  • javax.crypto
  • javax.crypto.interfaces
  • javax.crypto.spec
  • javax.swing

The JavaScript API file contains the following classes

  • Array
  • Boolean
  • Date
  • Math
  • Number
  • RegExp
  • String