Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Articles
Recherche: 

VisioModeler - a free CASE tool
Hilmar Zonneveld, May 1, 2006
This article is an introduction to VisioModeler. This is a free CASE tool, that can help you design your database, in the process sharing the information with the client in a visual, easy-to-understand, format.
Summary
This article is an introduction to VisioModeler. This is a free CASE tool, that can help you design your database, in the process sharing the information with the client in a visual, easy-to-understand, format.
Description
One of the most important parts of the design of a business system is the proper design of the database. This can be done "manually" (drawing on the designer's experience), or the developer can use the aid of pecial tools in a category known as CASE tools (computer-aided system engineering).

This article is an introduction to VisioModeler. This is a free CASE tool, that can help you design your database, in the process sharing the information with the client in a visual, easy-to-understand, format. VisioModeler uses an interface called ORM (Object-Role Modeling).

History

When I learned about InfoModeler several years ago, it cost 700 dollars (support for one DBMS), or 3000 dollars (support for multiple DBMSs).

Later, Infomodeler was bought by Visio, and renamed VisioModeler. Visio was eventually bought by Microsoft. Since Microsoft apparently has other plans for this kind of CASE tools, VisioModeler was declared "unsupported".

Download and requirements

VisioModeler is available for free at Microsoft’s site. Just go to www.microsoft.com, and search for “download visiomodeler”. The download is about 25 MB.

Being a somewhat older tool, the hardware requirements should cause no problems. For instance, it requires at least 16 MB RAM.

ORM

The user’s interaction with VisioModeler uses a model called ORM (Object Role Modeling). Instead of presenting information in the form of tables, information is presented in a way which, in my opinion, is much easier to understand for a client than information presented as “tables”, which is quite an abstract concept for anybody but computer programmers.

However, as we shall see, VisioModeler can also show information in table format.

A detailed description of ORM is beyond the scope of this article; the examples will give you an introduction to how information is presented. The help included in the product contains a detailed, more formal, description, for those who are interested.

Overview of the design process

  • The developer defines, graphically, relationships between different pieces of data. This information can also be shown to the client.
  • The developer generates the “logical diagram”, i.e., the list of tables. If there are error messages, or if the list of tables generated doesn’t “feel right”, he can go back to the previous step.
  • The developer generates a script that will either generate a new database – for his favorite DBMS (VFP is supported) – or modify an existing database.
  • Alternatively, VisioModeler can connect directly to the database server, through ODBC, and create or modify a database.
VisioModeler also has the capability of “re-engineering”, i.e., extracting information from an existing database, and generate either the logical diagram (tables), or the ORM model.

Getting started

OK, that's enough introduction for now; let’s get to work.

For a start, open VisioModeler, click on “File | New Model”, and under model type, select “Object Role Modeling Diagram”. While VisioModeler also lets you design logical diagrams (i.e., in a “table format”), for the purposes of this article we will start our design with an ORM model.

Next, we have to register a few facts that relate different pieces of data (“Objects”). For example, let us create a model for registration of students, as might be used at a university for example.

To see where we are going, here are some facts, in text form. Objects are underlined:

  • A student is active.
  • A student registers in a course.
  • A student has a code.
  • A student has a last name.
  • A course has a code.
  • A course has a description.
The first relation is unary (one object is involved), the remaining relations are binary (two objects involved).

However, when we analyze the relation "Student registers in Course", it turns out that a student may register in the same course more than once, for example, if he flunks it. So, for additional information (to uniquely identify each record in the resulting table), we might want to include the semester. This changes the second relation to a ternary relation (i.e., 3 objects involved):

  • A student registers in a course during a semester.
In VisioModeler, relations can have an arity (unary, binary, ...) between 1 and 9; the most common relation is the binary relation, and you would seldom need an arity higher than 4 in practice.

Image 1 shows the diagram in VisioModeler we want to achieve with this data.

Image 1: Initial model.

To achieve this model, you can proceed in different ways.

First, the hard (or more detailed) way, you can use the buttons on the ORM toolbar, as follows: the second button from the topo (with an oval) creates objects, such as “Student” or “LastName”. The third button from the top creates a relation; whereas the fifth button from the top is used to connect the relation with the objects.

Image 2: The ORM toolbar.

The quick way is to use the menu item “Tools | Create a New Fact” or the shortcut F5. For a start, use the guided version (under “Input style”). Finishing this window will create the objects (if objects by the specified names don’t exist yet), and the relation.

Image 3: The fact editor.

Yet another alternative is the command “Tools | Quick fact” (F6), which will create objects and relations, which you have to edit later, to fill in object names, among others.

Additional information

After creating the basic relationships, the kind of some objects should be changed to “Value”. Take the relation “Student has LastName”. The “student” data has additional properties (or associated data), that is, student is of kind “Entity”. “LastName” does not have additional properties, so it is of kind “value”. Values will eventually translate to fields, rather than separate tables. (Note: The formal definition used by ORM theory is different; read the online help if you are interested in the details.)

Double-click on “LastName”, and on the tab “Definition”, change the kind to “Value”. Note that this changes the outline of the ellipse to a dotted line.

I have done this with the “LastName”, "StudentCode", “SubjectCode” and “SubjectDescription” data items.

Also, for those data items that are defined as "entities" (i.e., the "kind" has not been changed to "value"), you can specify a "Reference"; this can be thought of as the primary key.

With those changes, your diagram should look similar to the first draft, shown above.

Constraints

VisioModeler allows the definition of several constraints to the data. The most important one is the UC constraint, or uniqueness constraint, and it is required for each relation. It tells us which data items, in a relation, can repeat, and which can’t.

One way to do this is to add examples to each relation, and let VisioModeler figure out the corresponding UC constraint, or constraints. This helps improve the documentation. You can also add UC constraints directly, with the constraints toolbar.

Let's try it the first way. Double-click on the relation "Student has LastName", select the "Examples" tab, and fill in the following examples:

Student LastName
1 Martinez
2 Smith
3 Smith
4 Johnson

Note that the last name "Smith" is repeated; this implies that, indeed, more than one student can have the same LastName. Examples should always show which data items (or combinations of items) can repeat, and which not.

If you like, click on the "Analyze" button to get a quick analysis of the examples. For example, VisioModeler will protest if you provide less than 4 rows of examples, in a binary relation, saying that more examples are required.

Now, click on "Set UC constraints", to place the UC constraints on the relation. In this example, you will get a double arrow over the first part of the relation, the one that corresponds to "Student". This means that this part of the relation can not be repeated. Indeed, that is exactly what our examples imply.

In a one-to-one relation (binary), on the other hand, you will get two double arrows, one for each part of the relation. In a many-to-many relation, you will get a single arrow that spans the entire relation; this means that the combination of the two parts can't repeat.

After placing examples and the corresponding UC constraints for a few additional relations, our model looks as the following image.

Image 4: Model, including UC constraints.

Nesting

As you may be aware, in a relational database a many-to-many relationship, such as "Student takes subject", translates to a separate table. Let's call this table (or entity) "Registration". It would make sense to convert the relation itself into an object, so that we can assign it additional properties; this is achieved through a process known as "Nesting".

Select the relation "Student / Subject / Semester", and, in the ORM toolbar, click on the fourth button from the top, "Nesting". This will create a rounded rectangle around our relation, with the name "StudentSubjectSemester". It makes sense to double-click on this new object and rename it to "Registration", or some other meaningful name.

Next, you can start to include the "Registration" object in other fact. For example, the student will eventually get a final grade, so the fact might read "Registration has FinalGrade".

Image 5: Nesting example.

In this particular case, the nested relation is ternary (three objects), but it can just as well be binary (the most common case), or have any other "arity".

When selecting the nested relation, you must distinguish between the relation (inside) and the nested object (outside); they are two different things.

Creating the logical model

After doing some modeling with ORM, we are ready to create the logical model, i.e., to show the data as tables.

You might first click on the "Check document" button to check for errors (a common one is missing UC constraints). Or, you can directly click on "Build Dictionary"; this will implicitly check the document first.

Field types

Field types can be defined either in the ORM model, or in the logical (tables) model (changes in the logical model can be migrated back to the ORM model). I suggest defining them in the ORM model; in general, I believe everything can be done in the ORM model, although at first it may take some time getting figurint out where to do things.

Field types can be defined in a generic ("portable") way, or for a specific database (e.g., Visual FoxPro).

Creating the database

The database itself is defined with the button "Generate database" of the main toolbar. You have the choice to either create a script that will generate the database (for example, a PRG that will run in Visual FoxPro), or connect via ODBC and create the database directly.

Other capabilities of VisioModeler include modifying an existing database, as well as re-engineering (extracting an existing database design, into either a logical or an ORM model).

Summary

This article was meant to give you a brief overview into this database modeling tool.

VisioModeler also offers some additional capabilities, such as additional constraints, which I will not currently delve into; the overview was meant to get you started.

Source code

Hilmar Zonneveld, Independent Consultant
Hilmar Zonneveld works in programming since 1986, using dBASE, FoxPro and Visual FoxPro. He is available as an independent consultant. He currently works as a programmer at Bata Shoe Organization; also as an instructor at Cisco Networking Academy. You can contact him through the Universal Thread, or, via e-mail, at hilmarz@yahoo.com. Personal Web page (mainly in Spanish): www.geocities.com/hilmarz.
More articles from this author
Hilmar Zonneveld, May 1, 2003
An audit-trail is a record of who did what changes, and when. In Visual FoxPro, this can easily be accomplished through triggers. I hinted at the possibility of doing an audit-trail, in my article on triggers - now, as a reaction to questions in the Universal Thread, I want to present a sample...
Hilmar Zonneveld, December 6, 2001
(The latest update contains minor edits only.) Five easy and fun ways to get yourself into trouble with inheritance. A frequent source of problems in OOP is called "breaking inheritance". This document briefly describes what inheritance is, how it applies to properties and methods, and how it ...
Hilmar Zonneveld, July 1, 2002
Introduction Buffering is a feature in Visual FoxPro that allows us to give the user "undo" and "save" capabilities. In the old FoxPro 2.x days, programmers either didn't provide this capability, or edited memory variables, and copied information between these variables and the table fiel...
Hilmar Zonneveld, October 6, 2005
Due to a recent Windows security fix, users can no longer access a CHM file on a server. The table of contents appears, but the individual pages are replaced by error messages. Access to CHM files in specific folders can be explicitly allowed through special registry settings.
Hilmar Zonneveld, July 20, 2001
(The last update contains minor edits only.) The idea is to have several controls on a form controlled with an array. Thus, you can quickly go through all the controls on the form, managing the array. The sample code included will help you get started quickly. You can easily adapt it to manage...
Hilmar Zonneveld, September 1, 2002
With Automation, you can control all aspects of Excel, Word, or other programs that provide this feature, from Visual FoxPro. In this article, I will concentrate on Excel. Its purpose is to provide a starting point, especially for people new to automation. Introduction With automation, you bas...
Hilmar Zonneveld, March 1, 2003
Introduction One common task in programming is to keep track of what problems are pending. For this purpose, I use a "hierarchical to-do list": a list of items, each of which can have sub-items. All you need is Microsoft Word. Alternatives are available as freeware or shareware, but in t...
Hilmar Zonneveld, October 7, 2005
This is a step-by-step tutorial to show inheritance, specifically in Visual FoxPro forms, as a guidance for people who are not familiar with inheritance in general, or who don’t know how to implement it in Visual FoxPro. The basic idea of inheritance is that all your forms, or several of your for...
Hilmar Zonneveld, May 30, 2004
The code shows how to quickly obtain the greatest common factor, and the least common multiple. Both functions are used when manipulating fractions, among others. Several methods are possible; the method usually taught in school involves prime numbers, but this code will execute much faster (and it ...
Hilmar Zonneveld, November 1, 2006
A standard requirement in a production system, or in systems for cost calculation, is to add up all the raw materials for a number of finished articles, to get the total cost, or simply to purchase the materials. In this article, Hilmar outlines how to do this with multiple levels of intermediate ar...
Hilmar Zonneveld, August 1, 2002
Overview The purpose of this article is to give an overview of normalization. Basically, normalization refers to having an efficient table structure. I will not discuss the famous "first to fifth normal forms" - if you want that information, enough texts exist about it in other places (search sit...
Hilmar Zonneveld, November 8, 2001
The following function will open any document, with its default association (the same application that will be called when you double-click on the file, in Windows Explorer). Use it to open a text-file, a Word or Excel document, an image, etc., with an external application.
Hilmar Zonneveld, May 1, 2002
Introduction This document explains the meaning of primary key, foreign key and candidate index in Visual FoxPro. A discussion of natural and surrogate keys (keys visible, or not visible, to the end-user) is included, including the advantages of each approach, as well as different methods for o...
Hilmar Zonneveld, January 1, 2003
Continuing my series of introductory articles, this article presents an introduction of a simple yet powerful programming concept: recursion. Introduction "To understand recursion, you must first understand recursion." "To make yogurt, you need milk and yogurt." If you are not accustomed...
Hilmar Zonneveld, December 1, 2002
Introduction This article presents an introduction to coding shortcuts in Visual FoxPro - when to use them, and when not to. Notes on coding in general This article is about coding shortcuts; however, I should first emphasize that making the code as small as possible is usually not the number...
Hilmar Zonneveld, July 20, 2001
Rushmore Optimization can help make queries much faster. However, "Full Rushmore Optimization" is not always a desirable goal. "Partial Optimization" is sometimes much faster. It is often believed that to speed things up, you need to have as many indices as possible. This article explains that so...
Hilmar Zonneveld, June 7, 2002
If you need to check elapsed time with seconds() or a datetime value, this function allows you to display the elapsed time in a human-readable format, that is, hours:minutes:seconds, instead of the total number of seconds. Just pass a number of seconds as a parameter.
Hilmar Zonneveld, April 1, 2002
SQL is a standard language used to manipulate databases. Several of the SQL commands are integrated into the Visual FoxPro language. Select This is a very flexible command, used to select data from a table, or from several tables. This command has options to get totals from several record...
Hilmar Zonneveld, August 1, 2003
In this article, I will show several ways to manipulate text-files. Knowledge of these methods is often important to import and export specific formats. Some of the techniques can also be used to work with files of any content; however, this article will concentrate on text-files. When ...
Hilmar Zonneveld, June 1, 2002
The purpose of this article is to show how to use some aspects provided by the Visual FoxPro database engine, to control our data. Indices Perhaps most readers already know indices; anyway, I find it convenient to include a brief summary of the topic, since this is a requisite to understan...
Hilmar Zonneveld, November 1, 2002
A help file can be used either for interactive help, or as an online manual. In this article, I will give an overview over creating help files in the new help format (CHM), for Visual FoxPro 6 and later. This article is introductory and assumes no prior knowledge of the Help Compiler, or of HTML cod...
Hilmar Zonneveld, February 1, 2003
Introduction Any real-world application will sooner or later misbehave. It is important to be able to find those problems. Visual FoxPro's built-in debugger can help a lot to find out why your program doesn't work as you thought it would. Most of the material in this article applies to Visual...