Apress Expert C sharp 2005 (Phần 6)

Tham khảo tài liệu 'apress expert c sharp 2005 (phần 6)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 2 27 06 1 25 PM Page 224 224 CHAPTER 4 DATA ACCESS AND SECURITY obj DataPortal_Execute A command object should implement all server-side code in its DataPortal_Execute method. Processing All Other Objects For any other objects most commonly subclasses of BusinessListBase the DataPortal_Update method is invoked followed by an optional call to MarkOld obj DataPortal_Update mark the object as old obj MarkOld As in Create and Fetch the DataPortal_OnDataPortalInvoke method is called before any of this other processing and DataPortal_OnDataPortalInvokeComplete is called once it is all done. The business object is returned as a result wrapped in a DataPortalResult object. Any exceptions are handled in the same way as in Create or Fetch . Delete In contrast to Update the Delete method is the simplest of the four. Like Fetch it creates an instance of the business object based on the criteria object obj CreateBusinessObject criteria Then it calls DataPortal_OnDataPortalInvoke followed by DataPortal_Delete and then DataPortal_OnDataPortalInvokeComplete . Since the result is that the object s data was deleted there s no business object to return. Thus an empty DataPortalResult is returned return new DataPortalResult This is required to return the global context data from the server back to the client just in case the business object changed the global context during the delete operation. The exception handling for Delete is the same as in the other three methods. That completes the SimpleDataPortal class and the message router behavior. Notice how all client calls are automatically routed to a dynamically created business object based on the type of business object required. SimpleDataPortal is entirely unaware of the particulars of any business application it blindly routes client calls to the appropriate destinations. Context and Location Transparency The final major area

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
30    171    2    04-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.