Design Pattern Fever : The cons of Design Pattern Learning

August 29, 2008

Junior Programmers should learn design patterns as soon as possible? or nope?

Sometimes when you learn design patterns, you ( junior programmers) may be infected by a disease called “Design Pattern Fever” (my own made up name).

How do you know you are infected? The symptoms are you try to implement every design patterns you ever learned in every aspects of your pograms. One says, junior programmers learning design patterns akin to monkeys holding a hand grenade.

Design Patterns are powerful. But there are the downsides still.

For your bed time reading :

http://www.codinghorror.com/blog/archives/000380.html

August 23, 2008

Numpang lewat dengan bacaan sebelum bobo about collections

http://www.precisejava.com/javaperf/j2se/Collections.htm

Collections : Introduction

August 23, 2008

A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers).

Sebuah Collection berfungsi sebagai container dari lebih dari satu elemen. Fungsinya seperti array, namun collection dapat diisi dengan elemen-elemen lebih dari satu tipe ( walau disarankan menggunakan tipe yang generic )

Secara umum Collection dibagi 3 jenis :

  • Set , elemen di dalamnya haruslah unik. Set ini sifatnya sederhana, tidak menggunakan index.
  • List, boleh mengandung elemen yang duplikat. Elemen yang dimasukkan secara implisit diberi index di urutan terakhir ( sistem index menyerupai array). Dapat disort, dan diretrieve dengan memanggil index dari elemen.
  • Queue, memakai konsep FIFO ( bagi yang familiar dengan struktur data pasti tahu). Jarang dipakai untuk saat ini.
  • Map, menggunakan sistem indexing yang eksplisit, dengan index ( atau disebut key) yang unik. Key atau index harus unik, dan dipasangkan dengan value boleh diduplikasi. Bayangkan saja dengan array yang menggunakan index yang dapat diatur-atur ( tidak harus dari 0 – etc)

Follow

Get every new post delivered to your Inbox.