Value Object Pattern
Posted: Thu Jun 29, 2006 4:55 am
I probably don't need this but I'm just looking to use it in a practical scenario since I haven't used it as yet 
Basically, I'm writing a stock control system for a school shop.
It only needs to be *very* basic. (I'm not really using an interface -- I'm just representing it this way).
Does using Value Object make sense here? I've yet to see where Value Object is actually of any use
Perhaps it's more suited to the side of things for adding and removing funds from the student.
Basically, I'm writing a stock control system for a school shop.
It only needs to be *very* basic. (I'm not really using an interface -- I'm just representing it this way).
Code: Select all
interface iStock
{
public function addItem($name, $price, $quantity=1, $description='');
public function removeItem($id);
public function increaseQuantity($id, $amount); //When more stock comes in
public function decreaseQuantity($id, $amount=1); //When a sale occurs
public function disableItem($id); //Disable it in the system so people can't buy it even if it's in stock
public function enableItem($id);
public function changePrice($id, $price);
}