TAILIEUCHUNG - MASTERING DELPHI 6 phần 8

Khi bạn viết một mô-đun dữ liệu truyền thống trong Delphi, bạn có thể dễ dàng thêm một số các ứng dụng logic, hoặc các quy tắc kinh doanh, bằng cách xử lý các sự kiện số liệu, và bằng cách thiết lập các thuộc tính đối tượng lĩnh vực và xử lý các sự kiện của họ. | 754 Chapter 17 Multitier Database Applications with DataSnap on the server. To accomplish this you ll need to add some more code to the client. However before we do that let s add some features to the server. Adding Constraints to the Server When you write a traditional data module in Delphi you can easily add some of the application logic or business rules by handling the dataset events and by setting field object properties and handling their events. You should avoid doing this work on the client application instead write your business rules on the middle tier. In the DataSnap architecture you can send some constraints from the server to the client and let the client program impose those constraints during the user input. You can also send field properties such as minimum and maximum values and the display and edit masks to the client and using some of the data access technologies process updates through the dataset used to access the data or a companion UpdateSql object . Field and Table Constraints When the provider interface creates data packets to send to the client it includes the field definitions the table and field constraints and one or more records as requested by the ClientDataSet component . This implies that you can customize the middle tier and build distributed application logic by using SQL-based constraints. The constraints you create using SQL expressions can be assigned to an entire dataset or to specific fields. The provider sends the constraints to the client along with the data and the client applies them before sending updates back to the server. This reduces network traffic compared to having the client send updates back to the application server and eventually up to the SQL server only to find that the data is invalid. Another advantage of coding the constraints on the server side is that if the business rules change you need to update the single server application and not the many clients on multiple computers. But how do you write .

TỪ KHÓA LIÊN QUAN
Đã 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.