mardi 18 octobre 2016

Command pattern for restaurant use case

I just start to learn design patterns, one is the command pattern. After reading some materials and some documentations, such as

http://ift.tt/1za0IZJ http://ift.tt/2eg2M2b

I got the idea of using command pattern for stock buying and selling. The client can first decide which stock he/she would like to sell or buy and then let the agent/broker to invoke the command's execute function. I think this makes sense.

While another 'classic' example is restaurant, which confuses me for quite a while. As a customer, how can a customer know which cook (receiver) will be able to cook the item (soup or grill in the example)? The cook shall be not decided by the customer I think. Can anyone point me out how I should approach this idea?

Thanks!

Aucun commentaire:

Enregistrer un commentaire