13 Jul 2007

: Proxy Object :




Gua Emang Benar-Benar capek Dehc, Stelah jalan melulu bolak² macam arus 2 arah ke kampung [ D' Sanggul <--> Langkat <--> Medan ] gua tempuh terus selama seminggu, yahh capek dehh.. sesampai di bus saya baru ingat tentang remote objek yg hampir terlupakan untuk di upload ulang s'telah saya habis kotak-atik tuh DOPOD pinjaman teman selama perjalanan saya di dukung oleh HSPDA XL -bebas tuhh sepanjang jalan lintas sumatra yang tidak kenal lelah N rasa bosan di bis...ehh ternyata saya buat percobaan ke salah satu IP yg saya kenal dulunya dr warnet dan melekat masih ingat tuh IP ampe sekarang, truz saya cobain deh dgn idenya " Proxy Objek " yaitu kesalah satu Objek IP proxy anak kampusan dehh gua cobain se ingat gua yahh (rahasia dehh..). Ternyata bisa di remote lohh..mau coba..? yoo kita planningkan dulu objeknya truz..ikuti nihh petunjuk gua. Wa juga dah capek beri petunjuk melulu :D )) apalagi baru sehabis adventure. tapi ingat gua iklas koq. Namanya jg ? Teman.
Nehh dehh silahkan akses and copy paste ke F-disk jika ga sempat bacainnya langsung di monitor ato terus print dehh :P !



Proxy Object ....?
Ini di coba/kita ciptakan ketika objek klien aktif pada remote objek nya..
Kita bisa memiliki 2 tipe untuk meremote objek i.e klien sasaran yang aktif atau sasaran server yg aktif.
Client Activated Object : Client Activated Remote Object adalah satu dari pengontrol yang bersifat hidup oleh pbjek klien.
Di sini satu kejadian sasaran tunggal asing yang akan ada objek per user.
Objek yang dilakukan oleh user, ditimbulkan menggunakan keyword baru.
Objek yang targetkan user yang bisa menyimpan informasi pada pusat bagian untuk seorang klien yang khas.

Server Activated Object: Berlawanan pada Client Activated Remote objects, Ketika server Activated Object di pegang dgn server .Sasaran ini diciptakan kalau sasaran user mengadakan metode di atas yang di wakili oleh sasaran.

Ada dua macam Server Activated Objects i.e. :
SingleCall dan Anak Tunggal.

SingleCall: ini melayani hanya satu permintaan user.
Satu kali permintaan user selasai, Ini akan di sampaikan ke recycle collection.
Ini tidak menyimpan informasi pada bagian pusat yang mana pun.


Singleton: Ini akan melayani klien yang berlipat ganda, thereby akan mengijinkan akses informasi serta membagikan antara permintaan/requets.
Mereka ialah stateful sasaran tidak seperti SingleCall, yang tanpa pusat.

Okey..kita akan uji terlebih dahulu..berharap anda tidak bakalan bingung yahh..!

//Creating a new instance of a remote object using new.
Employee Emp = new Employee();
//Creating a new instance of a remote object using CreateInstance.
Employee Emp = (Employee)Activator.CreateInstance(...);

Catatan : Pada metode diatas banyak kejadian pada sasaran yang lebih jauh lagi berdasarkan parameter yg di lewati. Untuk daftar yang lebih tntas silahkan mrujuk ke MSDN.


//Retrieving an Existing Instance.
Employee Emp = (Employee)Activator.GetObject( typeof(Employee), http://[path/]);

Untuk semua sebutan untuk remoet objek (at server side) adalah route yang mungkin pada proxy remote......
--------------------------------------------------------------------------------------------
All the calls to the remote object (at server side) are routed through proxy object. To make things little complicated, there are two types of proxy objects involved in the process i.e. Transparent proxy and Real proxy. Transparent proxy provides the implementation of all public method to Client object which means that client object always talks to Transparent proxy which in turn makes call to Real proxy. Real proxy passes the message to channel object. Developers can customize the Real proxy to include additional functionalities if required.
--------------------------------------------------------------------------------------------

pada sistem ini saya akan lebih baik menjelaskan dalam bahasa internasional dulu, biar pada ngerti nih anak yg satu ini [ Maksud nya anak IT yg pada sebel melulu bahasa indonesia pd komputer mereka, apalgi nih anak aleng (maksudnya Chinese yang agak janggal menggunakan Indonesia language.) Okehh saya serahkan dalam bahasa inggris aja yahh...
seperti diatas atau niihh yg berikutnya .

Formatters

They encode and decode the message between client application and Remote object. .Net Framework provides SOAP and Binary formatter. It also supports custom formatters (IRemotingFormatter) developed by programmers.

Binary Formatter: System.Runtime.Serialization.Formatters.BinarySOAP Formatter: System.Runtime.Serialization.Formatters.Soap

Channels

They are responsible for transmitting the message over the network. .Net Framework provides HTTPChannel and TCPChannel. It also supports custom channels (IChannel) developed by programmers.

HTTPChannel: System.Runtime.remoting.Channels.
HttpTCPChannel: System.Runtime.remoting.Channels.Tcp

By default HTTP Channel uses SOAP Formatter and TCP Channel uses Binary Formatter.
Channels need to be registered with the remoting service as shown below.


//Registering a channel
ChannelServices.RegisterChannel();

Hosting a Remoting Application

Remoting Host is a runtime environment for the remote object i.e. Microsoft IIS Server.
Step By Step: Let's see the entire step once again.
> Client object registers a channel.
> Creation of Proxy object (Client activated or Server Activated)
> Calling the method of remote object via proxy.
> Client side formatter formats the message and transmits via appropriate channel.
> Server side formatter reformats the message.
> The specified function on remote object is executed and the result is returned.
> Above process of formatting and reformatting is reversed and the result is returned to client object.
Kira² artikel diatas adalah suatu alasan mendasar (the basic terms and technology involved in .Net Remoting) untuk sistem remoting. Penegembang dapat mencipatakan dari beberapa aturan cahnnel dan Formatters yang dibutuhkan disaat urusan yg mendesak.
There is no built in security provided by .Net Remoting framework. The security features need to be provided by the hosting environment. Okey..kira² dahh pada jelas semua kan...nihh gua dah capekk habis ini mo main PS lagi dehh di kos ma teman² taruhan main cup pulak lagi yahh capek dehh cuman capuccino doankk... Thx... doain lagi semoga masih banyak artikel dan ide² yg muncul dari nihh brain gua..heheheh//sok bangat sihh loe,,

Tidak ada komentar: