Top 9 # Xem Nhiều Nhất Cách Vẽ Database Diagram Mới Nhất 4/2023 # Top Like | Techcombanktower.com

How To Create Er Diagram For Existing Mysql Database With Mysql Workbench

This artcle will show you how to create a diagram for existing MySQL or MariaDB database using MySQL Workbench.

Reverse engineer a database

To create a diagram from existing database you need to use reverse engineering functionality to create a model.

Learn about reverse engineering and models in MySQL Workbench

To reverse engineer database go to menu Database and choose Reverse Engineer… option.

When successfully connected wizard will show you list of available schemas on the server. Select the ones you want to reverse engineer.

Wait for reverse engineering to take place and when done continue with Next. Final screen shows you a summary of the import. Close with Finish.

Default diagram

When the process ends with success you get a new model (more about models here) with default diagram with all tables and views.

Clean out diagram

What you probably want to do right after you created a default diagram is to remove unnecessary tables and views and arrange tables to make it easier to grasp.

Be careful not to choose Delete option as it will remove table not only form diagram but also your model catalog. Without a warning!

Arrange tables

To arrange tables you can try autoarrange option, but you’ll need some manual work on top of that.

To use autoarrange go to menu, select Arrange and Autolayout.

To manually arrange tables simply select them and move around when you feel they fit best. Good luck.

Save model

Once you have completed your diagram make sure to save it. It is saved in a MySQL Workbench model in a .mwb file in Documents folder.

Export diagram

When your diagram is complete and safe it you can export it to png, pdf, ps or svg.

To export diagram go to menu, select File, then Export, select one of the available formats and provide folder and filename.

Here is my diagram:

See it in other formats:

A better way to share diagrams: Dataedo

There is a better way to create and share diagrams for existing databases – Dataedo. Here is a sample export of complete database documentation with diagrams:

See live HTML database documentaion sample

A few of the benefits:

Easy and convenient sharing in interactive HTML

Draw diagrams for databases with no FK constraints

Attach complete data dicionary

Try for free now

Phần Mềm Staruml Vẽ Sơ Đồ Use Case, Activity Diagrams, Sequence Diagrams

Hướng dẫn sử dụng Phần mềm StarUML, StarUML là phần mềm mã nguồn mở, có kích thước nhỏ gọn, hỗ trợ thiết kế với hầu hết các ngôn ngữ lập trình phổ biến hiện nay như C++, Java, C#, … giao diện thân thiện và là công cụ tuyệt vời hỗ trợ phân tích thiết kế theo hướng UML.

Phần mềm StarUML là phần mềm mã nguồn mở, có kích thước nhỏ gọn, hỗ trợ thiết kế với hầu hết các ngôn ngữ lập trình phổ biến hiện nay như C++, Java, C#, … giao diện thân thiện và là công cụ tuyệt vời hỗ trợ phân tích thiết kế theo hướng UML, hỗ trợ vẽ sơ đồ Use Case, Activity diagrams, Sequence diagrams tốt nhất hiện nay.

Trong bài này, chúng ta sẽ bàn về một số công cụ có thể dùng để biểu diễn và quản lý các bản vẽ UML một cách hiệu quả.

1. Giới thiệu các công cụ vẽ UML phổ biến

Có rất nhiều công cụ được sử dụng để vẽ các bản vẽ UML rất chuyên nghiệp như Rational Rose, Enterprise Architect, Microsoft Visio v.v.. và rất nhiều các công cụ phần mềm nguồn mở miễn phí có thể sử dụng tốt.

Các công cụ có cách sử dụng khá giống nhau và ký hiệu của các bạn vẽ trên UML cũng đã thống nhất nên việc nắm bắt một công cụ khi chuyển sang làm việc với một công cụ khá không quá khó khăn.

Trong bài này, xin giới thiệu với các bạn công cụ Start UML, một phần mềm nguồn mở, miễn phí, có đầy đủ chức năng và có thể sử dụng tốt trên môi trường Windows.

2. Giới thiệu về Start UML

Cài đặt

Bạn có thể download bộ cài đặt của phần mềm Start UML tại http://staruml.sourceforge.net/en/. Sau khi download và tiến hành các bước cài đặt chúng ta nhanh chóng có được công cụ này trên máy tính.

Các Model

Khởi động Start UML vào màn hình chính chúng ta có được các model như sau:

Hình 1. Cửa sổ giao diện của Start UML

Nhìn cửa sổ Model Explorer bên phải chúng ta nhận thấy có 5 model.

Use Case Model: chứa các bản vẽ phân tích Use Case

Analysis Model: chứa các bản vẽ phân tích

Design Model: chứa các bản vẽ thiết kế

Implementation Model: chứa các bản vẽ cài đặt

Deployment Model: chứa các bản vẽ triển khai

Tùy theo nhu cầu phân tích, thiết kế chúng ta xác định sẽ sử dụng model nào để thể hiện.

3. Cách tạo các Diagram

Để tạo các các bản vẽ, chúng ta chỉ cần chọn model mà bạn muốn sử dụng, kích phải chuột, chọn add diagram và chọn bản vẽ cần xây dựng.

Hình 2. Cách tạo ra một bản vẽ

Sau khi chọn bản vẽ, cửa sổ bên trái sẽ hiển thị thanh công cụ chứa các ký hiệu tương ứng của bản vẽ để bạn có thể vẽ được các bản vẽ một các dễ dàng.

Hình 3. Vẽ bản vẽ Use case

Việc xây dựng các bản vẽ chúng ta đã bàn kỹ trong các bài trước, bạn xem lại các bài trước và biểu diễn lại các bản vẽ này lên Start UML.

Video: https://www.youtube.com/watch?v=QMzLvR3jem4

4. Kết luận

Như vậy, chúng ta đã nghiên cứu qua tất cả các bản vẽ UML được sử dụng phổ biến trong OOAD. Đến đây, bạn đã có đủ kiến thức và kỹ năng để phân tích và thiết kế một phần mềm. Bây giờ bạn hãy cố gắng thực hành phân tích và thiết kế các hệ thống phần mềm để có thêm kinh nghiệm.

Các kiến thức này các bạn có thể dùng để phân tích và thiết kế một phần mềm mới hoặc dùng để mô tả nghiên cứu một phần mềm hoặc framework có sẵn nhằm phục vụ cho việc hiệu chỉnh phần mềm cho phù hợp với nhu cầu của khách hàng.

Trong một số trường hợp, cách thức cài đặt (codding) có thể khác với các bản vẽ thiết kế mà bạn đã tìm hiểu ở trên gây khó hiểu cho bạn. Đó là khi các hệ thống ấy sử dụng các Design Pattern như MVC Pattern, Delegate, Façade …. Vấn đề này chúng ta sẽ bàn trong chuyên mục “Design Pattern” trong thời gian tới hoặc bạn có thể tự nghiên cứu để hiểu thêm về vấn đề này.

Thự Hành Xây Dựng Bản Vẽ Activity Diagram

Trong bài trước chúng ta đã nắm được khái niệm, các thành phần, cách xây dựng và ứng dụng của Activity Diagarm. Bây giờ, chúng ta áp dụng nó để phân tích nghiệp vụ cho hệ thống eCommerce mà chúng ta đã xem xét trong bài số 3 của chuyên mục này.

Xây dựng Activity Diagram cho hệ thống eCommerceBước 1: Xác định các nghiệp vụ cần phân tích.

Trước tiên, chúng ta xem xét các Use Case. Về nguyên tắc bạn phải phân tích và mô tả tất cả các nghiệp vụ của hệ thống để làm rõ hệ thống. Xem xét bản vẽ Use Case Diagram chúng ta đã vẽ ở bài 3, chúng ta có thể thấy các Use Case sau cần làm rõ: – Xem sản phẩm theo chủng loại – Thêm sản phẩm theo nhà cung cấp – Thêm giỏ hàng – Chat – Quản lý đơn hàng – Thanh toán – Theo dõi chuyển hàng – Đăng nhập

Tiếp theo, chúng ta bắt đầu phân tích và vẽ cho chức năng xem sản phẩm theo chủng loại.

Để thực hiện chức năng xem sản phẩm theo chuẩn loại hệ thống sẽ thực hiện như sau: – Điều kiện ban đầu: ở trang chủ – Điều kiện kết thúc: hiển thị xong trang sản phẩm

Các bước như sau: – Người dùng chọn loại sản phẩm. – Hệ thống sẽ lọc lấy loại sản phẩm tương ứng, sau đó lấy giá, lấy khuyến mãi cho tất cả các sản phẩm đã được chọn và hiển thị lên màn hình. – Người dùng xem sản phẩm.Bước 3: Thực hiện bản vẽ – Chúng ta thấy có 2 đối tượng tham gia vào giao dịch này là Người dùng và Hệ thống. Chúng ta nên dùng Swimlance để thể hiện 2 đối tượng trên.

– Hành động tiếp theo là Guest chọn loại sản phẩm

Kết luận

Bản vẽ Activity Diagram sẽ giúp bạn mô tả nghiệp vụ của hệ thống một cách nhanh chóng, nó là công cụ hiệu quả trong việc mô tả hoạt động nghiệp vụ của hệ thống. Do vậy, các bạn hãy thực hành và sử dụng thành thạo bản vẽ này để thuận lợi trong việc phân tích, thiết kế hệ thống sau này.

Trong bài tiếp theo chúng ta sẽ thiết kế các chức năng của hệ thống thông qua việc sử dụng Sequence Diagram. Mời các bạn đọc tiếp.

Bài tiếp: Bản vẽ Sequence Diagram

Bài trước: Bản vẽ Activity Diagram

Create A Uml Use Case Diagram

You can create a UML use case diagram in Visio to summarize how users (or actors) interact with a system, such as a software application. An actor can be a person, an organization, or another system.

Use case diagrams show the expected behavior of the system. They don’t show the order in which steps are performed. (Use a sequence diagram to show how objects interact over time.)

Defining the system boundary determines what is considered external or internal to the system.

An actor represents a role played by an outside object. One object may play several roles and, therefore, is represented by several actors.

An association illustrates the participation of the actor in the use case.

A use case is a set of events that occurs when an actor uses a system to complete a process. Normally, a use case is a relatively large process, not an individual step or transaction.

On the File tab, point to New.

in the Search box, type UML use case.

In the dialog box, select the blank template or one of the three starter diagrams. (A description of each one is shown on the right when you select it.) Then select either Metric Units or US Units.

The diagram opens. You should see the Shapes window next to the diagram. A UML Use Case stencil is open in the Shapes window.

Drag a Subsystem shape onto the drawing page. The subsystem can represent your entire system or a major component.

To resize the subsystem, select the shape, and then drag a selection handle.

Drag Use Case shapes from the UML Use Case stencil and place them inside the subsystem boundary, and then drag Actor shapes to the outside of the subsystem boundary.

Use connector shapes to indicate relationships between shapes in the diagram. There are five connectors available:

Example: To indicate a relationship between an actor and a use case

In a use case diagram, drag an Association connector shape onto the drawing page.

Glue one endpoint of the Association shape to a connection point on an Actor shape. Glue the other endpoint to a connection point on a Use Case shape.

Open Visio for the web.

In the Gallery, scroll down to the UML Use Case row, about midway down the page.

The first item in the row represents a blank template plus the companion stencil. The other items in the row are sample diagrams that have some shapes already drawn to help you get started quickly.

The new diagram, with the related stencil, opens in your browser.

Drag a Subsystem shape onto the drawing page. The subsystem can represent your entire system or a major component.

To resize the subsystem, select the shape, and then drag a selection handle.

Drag Use Case shapes from the Use Case stencil and place them inside the subsystem boundary

Drag Actor shapes to the outside of the subsystem boundary.

Use connector shapes to indicate relationships between shapes in the diagram. There are five connectors available:

Example: To indicate a relationship between an actor and a use case

In a use case diagram, drag an Association connector shape onto the drawing page.

Glue one endpoint of the Association shape to a connection point on an Actor shape. Glue the other endpoint to a connection point on a Use Case shape.

On the File tab, point to New.

in the Search box, type UML use case.

In the dialog box, select the blank template. Then select either Metric Units or US Units.

The diagram opens. You should see the Shapes window next to the diagram. A UML Use Case stencil is open in the Shapes window.

To resize the subsystem, select the shape, and then drag a selection handle.

Drag Use Case shapes from the UML Use Case stencil and place them inside the subsystem boundary, and then drag Actor shapes to the outside of the subsystem boundary.

Use connector shapes to indicate relationships between shapes in the diagram. There are five connectors available:

Example: To indicate a relationship between an actor and a use case

In a use case diagram, drag an Association connector shape onto the drawing page.

Glue one endpoint of the Association shape to a connection point on an Actor shape. Glue the other endpoint to a connection point on a Use Case shape.

On the File tab, point to New.

A blank page appears, and the UML Use Case stencil becomes the top-most stencil. An icon representing the diagram is added to the tree view.

Note: If the tree view is not visible, on the UML tab, in the Show/Hide group, select Model Explorer.

To indicate a System Boundary in a use case diagram

Drag a System Boundary shape onto the drawing page.

To resize the system boundary, select the shape, and then drag a selection handle.

Drag Use Case shapes from the Use Case stencil and place them inside the system boundary, and then drag Actor shapes to the outside of the system boundary.

Use Communicates shapes to indicate relationships between use cases and actors.

To indicate a relationship between an actor and a use case

Glue one endpoint of the Communicates shape to a connection point on an Actor shape. Glue the other endpoint to a connection point on a Use Case shape.

If you want to add an arrow to indicate the flow of information, do the following:

Use Uses and Extends shapes to indicate the relationships between use cases.

To indicate a uses relationship between two use cases

Glue the Uses endpoint without an arrowhead to a connection point on the Use Case shape that uses the behavior of the other use case.

To indicate an extends relationship between two use cases

Glue the Extends endpoint without an arrowhead to a connection point on the use case providing the extension.

Save the diagram.

A blank page appears, and the UML Use Case stencil becomes the top-most stencil. An icon representing the diagram is added to the tree view.

To indicate a system boundary in a use case diagram

Drag a System Boundary shape onto the drawing page.

To resize the system boundary, select the shape, and then drag a selection handle.

Drag Use Case shapes from the Use Case stencil and place them inside the system boundary, and then drag Actor shapes to the outside of the system boundary.

Use Communicates shapes to indicate relationships between use cases and actors.

To indicate a relationship between an actor and a use case

Glue one endpoint of the Communicates shape to a connection point on an Actor shape. Glue the other endpoint to a connection point on a Use Case shape.

If you want to add an arrow to indicate the flow of information, do the following:

Use Uses and Extends shapes to indicate the relationships between use cases.

To indicate a uses relationship between two use cases

Glue the Uses endpoint without an arrowhead to a connection point on the Use Case shape that uses the behavior of the other use case.

To indicate an extends relationship between two use cases

Glue the Extends endpoint without an arrowhead to a connection point on the use case providing the extension.

Save the diagram.