TAILIEUCHUNG - Apress Expert C sharp 2005 (Phần 13)

Tham khảo tài liệu 'apress expert c sharp 2005 (phần 13)', 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 35 PM Page 574 574 CHAPTER 11 WEB SERVICES INTERFACE Second make careful note of the fact that only the public read-write properties and public fields are exposed. Non-public properties aren t exposed. Read-only properties such as Id on the Project and Resource objects aren t exposed. This is because the Web Services implementation in relies on the XmlSerializer object to convert objects into and out of XML and the XmlSerializer has limitations on what it will and won t serialize. Unless you re willing to compromise your object model s design specifically to accommodate the requirements of web service design you won t be able to expose the data you choose via Web Services. Beyond this Web Services requires that objects to be converted to and from XML expose a public default constructor. If the class doesn t provide a public default constructor you ll get a runtime exception when attempting to access the web service. The design of CSLA .NET business objects specifically precludes the use of public default constructors as they always use static factory methods to create instances of the business objects. Due to these drawbacks directly exposing the business objects isn t a good practice. The answer instead is to create a facade around the business objects that can separate the public interface of the web service from the interface of the business objects. This facade can be constructed so that its properties and fields are always available for serialization into XML. Returning Formal Data Structures You can easily create a formal data structure to define the external interface of a web service by using a class. The data structure of the class will define the public interface of the web service meaning that the web service interface is separate from the business object interface. The web service and this formal definition form a facade so that consumers of the web service don t know or care about the specific interface of the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.