IF2036 Rekayasa Perangkat Lunak Dwi Aji Mardiyanto Diagram Entity-Relationship Pemodelan Data dalam Rekayasa Perangkat Lunak IF2036 Rekayasa Perangkat Lunak Dwi Aji Mardiyanto
Komponen ERD Entitas (Entity) Relasi (Relationship) Atribut (Attribute) Kardinalitas (Kardinality) Modalitas (Modality)
Entitas Definisi Contoh Entitas Sebuah barang atau obyek yang dapat dibedakan dari obyek lain Contoh Individu : pegawai,pelanggan, mahasiswa,distributor. Tempat : ruang,bangunan,kantor,lapangan,kampus. Obyek: buku,motor,paket software,produk Peristiwa: pendaftaran,pemesanan, penagihan Konsep : rekening,kualifikasi.
Contoh Entitas Bangunan Produk Pelanggan
Relasi Definisi Asosiasi 2 atau lebih entitas Berupa kata kerja Relasi Mengambil Mata Kuliah Mahasiswa
Address Atribut Definisi Properti yang dimiliki setiap entitas yang akan disimpan datanya. Contoh Atribut Pelanggan No KTP/SIM Nama Alamat An organization can only work on only a limited number of projects at a given time due to limited resources so care must be taken when selecting the projects to build. After all possible projects are identified, those deemed most likely to yield significant organizational benefits, given available resources, are selected for subsequent development. Some possible evaluation criteria for ranking potential projects are: strategic alignment, potential benefits, potential costs and resource availability, project size and duration, and technical difficulty.
Kardinalitas Relasi Definisi Angka yang menunjukkan banyaknya kemunculan suatu obyek terkait dengan kemunculan obyek lain pada suatu relasi Kombinasi yang mungkin : (1:1, 1:N, M:N) An organization can only work on only a limited number of projects at a given time due to limited resources so care must be taken when selecting the projects to build. After all possible projects are identified, those deemed most likely to yield significant organizational benefits, given available resources, are selected for subsequent development. Some possible evaluation criteria for ranking potential projects are: strategic alignment, potential benefits, potential costs and resource availability, project size and duration, and technical difficulty.
Contoh Departemen Pegawai Memiliki 1 N 1 Departemen mungkin mempekerjakan 1 atau lebih pegawai 1 Pegawai hanya bekerja pada sebuah departemen
Kardinalitas Relasi Setiap 1 obyek A berelasi dengan tepat 1 obyek B dengan tepat 1/N obyek B dengan tepat 0/N obyek B dengan tepat N obyek B A A B A B A B A B
Modalitas Relasi Definisi Contoh Partisipasi sebuah entitas pada suatu relasi 0 jika partisipasi bersifat “optional”/parsial 1 jika partisipasi bersifat “wajib”/total Contoh Partisipasi total Setiap anak memiliki ibu Partisipasi parsial Tidak setiap perempuan memiliki anak An organization can only work on only a limited number of projects at a given time due to limited resources so care must be taken when selecting the projects to build. After all possible projects are identified, those deemed most likely to yield significant organizational benefits, given available resources, are selected for subsequent development. Some possible evaluation criteria for ranking potential projects are: strategic alignment, potential benefits, potential costs and resource availability, project size and duration, and technical difficulty.
Contoh 1 N Memiliki Departemen Pegawai 0..1 1..* Departemen Memiliki Setiap departemen setidaknya harus memiliki seorang pegawai. Seorang pegawai yang tidak harus termasuk dalam sebuah Departemen menunjukkan modalitas parsial. 0..1 1..* Departemen Memiliki Pegawai
Entitas Lemah/Kuat Entitas Kuat : Entitas yang memiliki atribut kunci (Key) Entitas Lemah : Entitas yang biasanya berasal dari atribut multivalue pada entitas lain. Mahasiswa NoKTP Memiliki Hobby Nama
Pemodelan Data yang Baik Sederhana Tidak ada duplikasi data (redundant) Fleksibel dan mudah beradaptasi dengan perkembangan
Contoh Pemodelan Data An organization can only work on only a limited number of projects at a given time due to limited resources so care must be taken when selecting the projects to build. After all possible projects are identified, those deemed most likely to yield significant organizational benefits, given available resources, are selected for subsequent development. Some possible evaluation criteria for ranking potential projects are: strategic alignment, potential benefits, potential costs and resource availability, project size and duration, and technical difficulty.
Representasi Tabular
Contoh ERD Sederhana
SOAL Unit pengadaan barang produksi pada sebuah perusahaan melakukan transaksi dengan para supplier untuk mendapatkan barang (parts) yang dibutuhkan perusahaan. Gambarkan ERD untuk kasus ini!
Solusi S# SName P# PName S# P# S# SName P# PName Ship Parts N M Suppliers N M S# SName Suppliers: Parts: P# PName Shipments: S# P#
Soal Sebuah bank memiliki beberapa cabang di daerah yang berlainan. Masing-masing cabang memiliki pelanggan yang relatif banyak. Sebuah rekening mungkin saja dimiliki oleh beberapa pelanggan dan setiap pelanggan boleh memiliki beberapa rekening. Gambarkan skema ERD dan tabel untuk kasus ini. Tambahkan layanan peminjaman uang(kredit) pada skema ERD tersebut. An organization can only work on only a limited number of projects at a given time due to limited resources so care must be taken when selecting the projects to build. After all possible projects are identified, those deemed most likely to yield significant organizational benefits, given available resources, are selected for subsequent development. Some possible evaluation criteria for ranking potential projects are: strategic alignment, potential benefits, potential costs and resource availability, project size and duration, and technical difficulty.
Soal(2) Sebuah perusahaan memiliki banyak pelanggan yang telah memesan sejumlah barang produksinya. Gambarkan diagram ER proses transasksi pembelian ini dan tabel untuk kasus ini. An organization can only work on only a limited number of projects at a given time due to limited resources so care must be taken when selecting the projects to build. After all possible projects are identified, those deemed most likely to yield significant organizational benefits, given available resources, are selected for subsequent development. Some possible evaluation criteria for ranking potential projects are: strategic alignment, potential benefits, potential costs and resource availability, project size and duration, and technical difficulty.