2009. március 13., péntek

3rd Lab Assignment

You'll have to use the Observer and Mediator patterns today.
  • You'll have to create at least 3 types of resources. These resources should be generated in random intervals.
  • Create Objects that observe resources and when there are enough resources generated, they harvest them and produce a component. This process should take random time (200-3000 ms).
  • Producers should be observed by a CentralOffice (a Mediator). When components are ready, the main factory should be ordered to assemble the product.
  • Each object should run in a separate thread.
  • The CO observes the main factory as well.
  • When there is a product ready, the factory should notify it's observers.
  • When there are 13 products, the CentralOffice should shut down all threads and exit the program.

Nincsenek megjegyzések:

Megjegyzés küldése