1 / 14

Konsep Interface: Membangun Interoperabilitas

Konsep Interface: Membangun Interoperabilitas. Lukito Edi Nugroho. Apakah Interface ?. Secara umum, interface menunjukkan batas-batas antara dua pihak (hardware, software, pemakai) yang saling berkomunikasi

carney
Download Presentation

Konsep Interface: Membangun Interoperabilitas

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Konsep Interface:Membangun Interoperabilitas Lukito Edi Nugroho

  2. Apakah Interface ? • Secara umum, interface menunjukkan batas-batas antara dua pihak (hardware, software, pemakai) yang saling berkomunikasi • Pada umumnya menjelaskan tentang abstraksi sebuah entitas yang ingin ditunjukkan ke pihak lain (publik) • Interface memisahkan fitur (layanan) dari implementasinya  menerapkan prinsip information hiding

  3. Ilustrasi Interface privat publik “pesan nasi goreng” “memasak nasi goreng” Nasi goreng Mie goreng Mie bakso Interface berupa menu menunjukkan abstraksi tentang layanan yang dapat disediakan oleh warung makan

  4. Interface Memisahkan Publik & Privat Publik Privat server (object implementation) client X interface Y Z implementasi

  5. Remote Procedure Call

  6. Interface dalam RPC • Interface Definition Language (IDL) • Mendefinisikan karakteristik prosedur di sisi server yg dapat dipanggil oleh client • Nama prosedur • Parameter, tipe datanya, dan kategorinya (in, out, inout) • Spesifikasi interface dlm IDL dapat dikompilasi utk digunakan oleh bhs pemrograman yg berlainan  client & server dpt ditulis scr independen • Contoh: Sun RPC • Dirancang utk komunikasi client-server pd Sun NFS • IDL: XDR, kompiler IDL: rpcgen • Bahasa pemrograman: C

  7. Interface dalam RPC // In file Person.idl struct Person { string name; string place; long year; } ; interface PersonList { readonly attribute string listname; void addPerson(in Person p) ; void getPerson(in string name, out Person p); long number(); };

  8. Interface dalam Bahasa Pemrograman • Interface mendefinisikan behaviour yang dapat diimplementasikan oleh sembarang kelas dalam struktur hirarki kelas • Dalam bahasa pemrograman, interface diwujudkan sebagai sekumpulan definisi method (tanpa implementasi)

  9. Contoh: Interface dalam Java

  10. Contoh: Interface dalam Java public class StockApplet extends Applet implements StockWatcher { ... public void valueChanged(String tickerSymbol, double newValue) { if (tickerSymbol.equals(sunTicker)) { ... } else if (tickerSymbol.equals(oracleTicker)) { ... } else if (tickerSymbol.equals(ciscoTicker)) { ... } } }

  11. Interface dalam CORBA • Definisi interface harus menggunakan bahasa yang “netral” • Bahasa khusus: Interface Definition Language (IDL) • Secara sintaks mirip C, tapi tidak memiliki struktur kendali program • Focus pada what, bukan how

  12. Contoh: IDL dalam CORBA

  13. Pemanfaatan IDL dalam CORBA

  14. Interface dalam Sistem-Sistem Lain • OLE/COM • .NET • Web service

More Related