Bài 10: Thiết kế cơ sở dữ liệu

Các thao tác giải quyết với dữ liệu persistent. Các thao tác trong đó có câu truy vấn liên quan đến tính toán. Các thao tác cần truy cập dữ liệu để kiểm tra tính hợp lệ của dữ liệu. | OBJECT-ORIENTED ANALYSIS AND DESIGN WITH UML Bé m«n C«ng nghÖ phÇn mÒm KHOA CÔNG NGHỆ THÔNG TIN TRƯỜNG ĐẠI HỌC BÁCH KHOA HÀ NỘI Bài 10. Thiết kế CSDL Nguyễn Thị Thu Trang, SE-FIT-HUTEssentials of Visual Modeling w/ UML - Instructor Notes Nội dung Thiết kế mức vật lý cho biểu đồ E-R Phân phối hành vi của lớp vào cơ sở dữ liệu In this step, our purpose is to determine the behavior of the class that can be distributed to and implemented by the database. This is done only after the design of the persistent classes has stabilized. 1. Thiết kế mức vật lý cho biểu đồ E-R Thiết kế trên một hệ quản trị CSDL nào đó Các thực thể Các bảng Mối liên hệ Ràng buộc tham chiếu Các kiểu dữ liệu của lớp Các kiểu dữ liệu của hệ quản trị CSDL Thiết kế biểu đồ CSDL mức vật lý Ví dụ 2. Phân phối hành vi của lớp vào cơ sở dữ liệu Quyết định các thao tác nào cần được thực thi thành một thủ tục lưu trữ Cần xem xét: Các thao tác giải quyết với dữ liệu persistent Các thao tác trong đó có câu truy vấn liên quan đến tính toán Các thao tác cần truy cập dữ liệu để kiểm tra tính hợp lệ của dữ liệu Thủ tục lưu trữ là gì? Là đoạn mã có thể thực thi được chạy trong RDBMS Có 2 loại thủ tục được lưu trữ: Thủ tục (procedure): Được thực thi rõ ràng bởi ứng dụng Trigger: Được gọi ngầm định khi một sự kiện nào đó của CSDL xảy ra Most databases support a stored procedure capability. A stored procedure is executable code that runs within the process space of the database management system. Stored procedures provide the ability to perform database-related actions on the server without having to transfer data across a network. Their judicious use can improve performance of the system. Stored procedures usually come in two flavors: actual procedures and triggers. Procedures are executed explicitly by an application. They generally have parameters and can provide an explicit return value. Triggers are invoked implicitly when some database event occurs (insert a row, update a row, delete a row, and so on). They have no parameters (because they are invoked implicitly) and do not provide explicit return values. In database systems that lack constraints, triggers are often used to enforce referential and data integrity. Otherwise, they tend to be used when an event needs to trigger (or cause) another event. Stored procedures are the mechanism by which a RDBMS can provide behavior to the application. Ví dụ CourseInfo + getCourseInfo(String):CourseInfo Class Candidate Operations getCourseInfo The class Student has been designed with a number of operations. The designer and database designer should sit down and determine which operations can be implemented by using a stored procedure. Candidate operations for the Student class include: getTuition addSchedule getSchedule deleteSchedule getStudentID getName getAddress The reason that these operations are considered candidates is that they deal with retrieving, creating, or deleting persistent data.

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.