Visio-based database modeling in Visual Studio. NET Enterprise Architect: Part I./1

Source: Internet
Author: User
Tags contains final visual studio
enterprise|visual| Data | database Terry Halpin
Microsoft Corporation
November 2001
Summary:This article is the first in a series of articles on the Visio-based database modeling component in Microsoft Visual Studio. NET Enterprise Architect, highlighting the object role modeling (ORM) support provided by the tool.

Directory

    • Brief introduction
    • Create a new ORM model
    • To add a sentence type using the Fact Editor (Fact editor)
    • To add a basic internal constraint using the Fact Editor (Fact editor)
    • Add an example to the fact type
    • Display sentence types on a drawing
    • Mapping an ORM model to a logical database model
    • Summarize
    • Reference bibliography
Brief Introduction
The data modeling solution in Microsoft®visio®enterprise 2000 provides conceptual information analysis using the object role model (ORM), as well as the use of relationships, IDEF1X, Crowsfoot and object-relational notation provide basic support for modeling logical database. ORM architecture enables the implementation of forward engineering to obtain a logical database schema from which to generate a physical database schema for a variety of database management systems (DBMS). Reverse-engineering The structure of the physical database to obtain a logical database schema or an ORM schema. The most recently released Microsoft Visio 2002 product contains only the Standard and Professional editions, and the Professional version contains a previously separate technical version, but does not contain a Enterprise version. Although the Visio 2002 Professional contains an ORM stencil, it is used only for drawings because its ORM diagrams cannot be mapped to the logical database schema and cannot be obtained from the physical database by implementing reverse engineering. The Visio 2002 Professional contains a database modeling solution that defines a new logical database schema or reverse-engineering it from an existing database, but does not implement a forward project to obtain the physical database schema.
Microsoft once supported database design and program code design (using UML) within its Visual Studio product range. After the acquisition of Visio Corporation, Microsoft has two separate products (Visio Enterprise and Visual Studio) that support database design and UML, and have significant functional duplication. To unify these product features, the original deep modeling solution within the Visio Enterprise has been enhanced and transferred to the Microsoft new product Visio for Enterprise Architects (VEA), which is included in the Microsoft ®visual studio®.net Enterprise Architect). These Visio modeling solutions are included in the Beta 2 of Visual Studio. NET Enterprise, and will be included in the final release later. The deep ORM solution in Vea is completely different from the simple ORM drawing stencil in Visio Professional, and the two cannot be converted to each other. However, the database modeling solution in Vea can be imported from the Visio Professional and then implemented forward engineering to obtain a DDL script or a physical database schema.
This series of articles briefly describes how to use a database modeling solution within VEA. Microsoft Corporation has obtained trademark, copyright, or patent rights for all aspects of information (for example, company name, product name, user interface). This article mainly introduces the basic content of the ORM solution, assuming that the readers of this article are familiar with ORM and relational database modeling. An ORM overview can be downloaded from the Web [bibliography]1 and Bibliography 2]. ORM's deep processing and database modeling will be discussed in my latest book [Bibliography]3]. Create a new ORM model
The Visio based modeling tool runs as a stand-alone solution in Visual Studio. NET Enterprise Architect. When you open the tool, the opening screen of the beta version is shown in Figure 1. Choose Database(database) As a drawing type, and then select the related ORM template. If the user is located in the United States, the ORM Source Model (US units) is typically selected as follows (the default page size is letter and the default unit of measure is inches). When you hover the cursor over the template icon, the icon is highlighted and the tooltip appears on the left. Visio offers the American version and the International (Metric) version of two templates. If you choose ORM Source Model without (US units), the default page size is A4 and the default unit is metric.
Note: in the final release, only standard unit systems that apply to the user's country/region are installed unless you select a different version.

When you select the ORM source Model template, the screen shown in Figure 2 is displayed. In addition to the top menu and icon, there is an ORM stencil, a Drawing (drawing) window, and an area for displaying the Business Rules Editor, the Database property sheet, and other windows that might be open (for example, Verbalizer (descriptor)).

Figure 1: Choosing to use the ORM Source Model (ORM sources) (click image to view large picture)

Figure 2:orm Stencils, Drawing (Drawing) window and Business rules (Business Rules) window (click image to view large picture)
To reduce the amount of space occupied by Figure 2, I have adjusted the size of the display to the greatest extent possible. Usually the Drawing window will occupy most of the screen. By default, three shapes in the ORM stencil are displayed in the same horizontal row. By reducing the width of the ORM stencil so that three shapes are vertically arranged, you can provide more space for the Drawing window, as shown here. To adjust the stencil width, hover the cursor over the border between the stencil and the drawing window, and drag the border to the left when the cursor changes to the resize cursor. To add a sentence type using the Fact Editor (fact editor)
You can add a sentence type (fact type or reference type) to an ORM model by dragging the object type (object types) and the predicate (predicate) shape from the stencil to the Drawing window. In addition, you can add sentence types using the Fact Editor (Fact editor). Now, let's use the Business Rules editor to do this. Move the cursor to the bottom row of the Fact Types (Fact type) pane in the Business rules (Business Rule) window (in this case, only one row). Enter the fact type or press the F2 key. Displays the Fact Editor (Fact editor). You can also pass from the top of the screen Database(database) menu, select database| view| Fact Editor(Database | view | Fact Editor) to invoke the Fact Editor (Fact editor). By default, the input style of the Fact Editor (fact Editor) is guided (guided), as shown in Figure 3.

Figure 3: The Fact Editor (fact Editor) for entering the style window using guided (guided) (click the image to see a larger picture)
You can enter a two-yuan relationship that provides forward reading (for example, employee works for department[employees in the department)) and reverse reading (for example, Department employs employee [departmental hire]). If you want, you can select from two dollars the number of changes in the relationship (number of roles). The object pane allows the user to divide objects into entity types, value types, or external object types. If the entity type has a simple identification scheme, you can add its reference mode (for example, employee number and department code).
After you are familiar with the Fact Editor (fact Editor), you may want to change its input style to Freeform (freeform) so that you can enter sentence types more quickly by using formal syntax. To change the input style to Freeform, you can use option buttons, and you can make Freeform the default type by following these steps: Go to the top of the screen Database(database) menu, select Database | Options | Modeling ...(Database | Options | Modeling ... , and then open the Fact Editor (Fact Editor) pane and set the preferred mode to Freeform, as shown in Figure 4. In many languages, you can easily identify an object type by naming it as a word (for example, employee [Employees] and VicePresident [vice-president]) by capitalizing the name of the object type in the first letter. For languages that are not suitable for this method, or when the name consists of multiple words separated by a space, you should select the bracket pattern: Enclose the object type name in square brackets (for example, [employee], [Vice President]).

Figure 4: Set the default output style for the Fact Editor (Fact Editor) to Freeform
In Freeform mode, the reference mode appears in parentheses following the object type name. If reverse reading is applied, the backslash (/) is used to distinguish forward reading from backward reading.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.