///
class Customer{
public:
static create(CString name){
//return new Customer(name);
return _instances.get(name);
};
static void loadCustomers(){
new Customer("Lemor").store();
new Customer("Associated").store();
}
private:
Customer(CString name);
void store(){
_instances.put(this.getName(), this);
}
static Dictionary _instances = new Hashtable();
};
class Order{
public:
Order(CString customer)
{
_customer = Customer.create(customer);
}
private:
Customer _customer;
};