import java.util.Hashtable; // Java lookup mechanism based on key public class Bean { // some business object public String ID; // primary key public static Hashtable beans = new Hashtable(); // find bean keyed on ID // static: just one hashtable public Bean(String ID) { this.ID = ID; // store ID in public String beans.put(ID,this); // put itself into the hashtable using primary key } public String toString() { // printable business object return (ID); } }