08 December 2010

Software Design Puzzle #4 - Apple Farm

This time, it is producers and consumers. Here is the story

There is a apple farm and the season is at its peak. The farm has many trees and each tree has numerous apples. The owner decides to harvest the apple and invites bids from various folks who are interested to buy apples. Some of them want the apples to be sent to their places and some of them are ready to reach the farm to procure the apples. So, the farmer plans for the harvest. He employs few hundreds of people - some to pick apples from the tree and some to package/transport apples. And by the way, the farmer sends apple as package of 500 apples.

Can you bring out classes and their relationships to fulfill the above requirements?