Bài giảng Công nghệ lập trình tiên tiến: Chương 5 - ĐH Công nghệ Đồng Nai
Thông tin tài liệu:
Nội dung trích xuất từ tài liệu:
Bài giảng Công nghệ lập trình tiên tiến: Chương 5 - ĐH Công nghệ Đồng Nai DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY .NET Remoting 1 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Net Remoting Definition: • Application which is located in another application domain or process can communicate with another by using .Net Remoting. • Net Remoting allows processes to share the objects. It can call the method and can access the properties of an objects that are: 2 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Ø Hosted in different application domain with in the same process or Ø Different process executing on same computer or Ø Different computers connected by LAN or Ø Different computer distributed over world wide 3 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Modern applications are no longer stand-alone applications. - Provides a solution for communication between application domains .NET Remoting: 4 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY You known Application Domain ?: Application domain is the collection of classes, which isolate these from other applications. The application in one application domain could not access the application in other application domain (without using Remoting) 5 2 Object type DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Remotable • It can be accessed outside its Object application domain. Ø CLR objects cannot, by default, be used outside their AppDomain - No way to copy them Non - No way to reference them Remotable Ø Exception occurs when you try to Object pass an object reference to a different domain Ø SO: It can not be accessed outside its own application domain. 6 Remotable Object: DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Ø Can request that instances of a class be accessible outside original AppDomain – Client get a copy of the object – Client get a reference (proxy) to the original object Ø When an object is Remotable? The object should inherit the class System.MarshalByRefObject Ø Two Types of Remotable Objects are there – Marshal by Value – Marshal by Reference *More detail later 7 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Object Serialization: Conversion of an object (instance) into a data stream of bytes, Serialization is a method of persisting objects for storage in a database, to various media, or during marshaling—the process of moving an object to a new application domain, context, process, or system. Serialization is performed by the Common Language Runtime (CLR). 8 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY MarshalByRef objects: Ø When the object's class derives, directly or indirectly, from MarshalByRefObject, the runtime creates a proxy to the object [Serializable] class Foo : System.MarshalByRefObject { . . . } Ø Clients in foreign AppDomains receive proxy Ø How does a client specify what proxy? 9 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Serializable objects: Ø When runtime can make a copy of the object, an object can marshal-by-value to other AppDomains – Add SerializableAttribute – Or implement the ISerializable interface [Serializable] Class Far { . . . } 10 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY Remoting in general : q Clients must connect to servers Ø Server needs to publish an object • I listen on this TCP channel and that HTTP channel • I have a service called MathService • When client connects to MathService using a supported channel, give the client [ a | this ] Calculator instance Ø Clients need to specify the desired object • Connect to the MathService on server LightningFast using protocol HTTP on port 80 11 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY ASP.NET Web services (WS) vs .NET Remoting (NR) See next slide… 12 DONG NAI UNIVERSITY OF TECHNOLOGY HO CHI MINH UNIVERSITY OF INDUSTRY 1. WS: only be accessed over HTTP; NR various protocols like TCP, HTTP etc. 2. WS stateless environment, NR state management 3. WS more reliable than .NET Remoting. 4. WS are easy to create and use, NR are complex to be created. 5. WS across platforms, NR requires client to be built using . ...
Tìm kiếm theo từ khóa liên quan:
Công nghệ lập trình Bài giảng công nghệ lập trình Lập trình tiên tiến Thiết kế giao diện Truy xuất dữ liệu Lập trình mạngGợi ý tài liệu liên quan:
-
Bài giảng Phân tích thiết kế hệ thống thông tin - Chương 9: Thiết kế giao diện
21 trang 189 0 0 -
Đề tài: Thiết kế hệ thống điều khiển và giám sát trên nền WinCC sử dụng mạng Profibus
174 trang 184 0 0 -
Giáo trình Phân tích thiết kế hệ thống thông tin quản lý: Phần 2
36 trang 177 0 0 -
Đề cương chi tiết học phần: Mạng máy tính và lập trình mạng
4 trang 160 0 0 -
Báo cáo bài tập lớn môn Mạng máy tính và Lập trình mạng: Tìm hiểu về Soap
32 trang 136 0 0 -
Khóa luận tốt nghiệp: Xây dựng Firewall & IPS trên checkpoint
94 trang 133 0 0 -
204 trang 129 1 0
-
349 trang 123 0 0
-
Giáo trình Công nghệ phần mềm - Đề tài Quản lý nhà sách
79 trang 121 0 0 -
48 trang 113 0 0
-
Bài giảng Lập trình mạng - Chương 1: Giới thiệu Lập trình mạng
18 trang 108 0 0 -
Giáo trình Lập trình mạng: Phần 1 - Trường Đại học Phan Thiết
78 trang 75 0 0 -
Giáo trình Lập trình mạng: Phần 1
54 trang 61 0 0 -
Giáo trình Lập trình mạng - ThS. Văn Thiên Hoàng
201 trang 56 0 0 -
183 trang 52 0 0
-
17 trang 47 0 0
-
Bài giảng Xây dựng website thương mại điện tử: Phần 1
55 trang 41 0 0 -
Bài thuyết trình nhóm: Công nghệ phần mềm thiết kế giao diện người dùng
40 trang 36 0 0 -
Tài liệu hệ thống phát hiện xâm nhập
14 trang 34 0 0 -
Bài giảng Lập trình mạng: Phần 1
75 trang 33 0 0