professional java user interfaces phần 5

Các vấn đề thực hiện Thông qua một kiến trúc phần mềm để tách logic miền với phần còn lại của việc thực hiện giao diện đồ họa, như chúng ta sẽ thấy trong Chương 7. Sử dụng một đại diện rõ ràng của các quy tắc kinh doanh có thể tương thích với phần còn lại các mã giao diện đồ họa và có thể được triển khai từ một máy chủ | 232 Implementation Issues Adopting a software architecture for separating domain logic from the rest of the GUI implementation as we will see in Chapter 7. Using an explicit representation of business rules that can interoperate with the rest of the GUI code and that can be deployed from a server at runtime as needed. This solution may involve the adoption of a little language such as a script language specialized for business logic. This is a technically non-trivial solution that makes sense in large applications with many mission-critical and dynamic business rules. A cheaper alternative is to formalize business rules with a lightweight OOP framework that is embeddable into the rest of the client application and provides some form of zero-deployment6 mechanism. Separating business logic in packages or classes that are shared with the server code base. This eliminates code duplication but necessitates a new application build and deployment to clients after changes in business rules. As a minimum solution using the principle of single functional responsibility to identify explicitly portions of code that are intended to capture business behavior. This ensures simple traceability of business logic code within the application but alone does not enforce decoupling and modularity. Domain logic can creep into GUIs in unexpected ways. Suppose you have a form that shows customers loans. Your client wants customers with a debit rate higher than 10 of their annual income to be signaled by the GUI with a special warning icon and to require extra confirmation when such customer s data is manipulated. A rule isCautionCustomer is then clearly part of the business domain layer even if it is used only on the client. It is important to address explicitly the representation of business logic within the application design. Lack of awareness can easily lead to tangled code that becomes increasingly hard to maintain as the application evolves. For large applications it is also .

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
20    90    1    10-05-2024
Đã 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.