programmation événementielle

Le retour du solveur de sudoku

Il y a quelques temps, j'ai développé un solveur de sudoku. C'était un premier jet qui comporte quelques erreurs de misconceptions. Comme ça m'empêchait de dormir en rond, j'ai finalement décidé de le refaire. Mais l'affaire ne s'arrête pas là...

CoffeeBar Application 19/19 - Closing the tab

To check out a tab, we only need one field in a form. If the amount paid is less than the invoice, it is impossible to checkout the tab. If the amount paid is more than the invoice, we count the difference as a tip.

CoffeeBar Application 18/19 - The bill, last but not least

Service is running. Prepared food is served. Ordered drinks are served. As they are served, the application is counting the bill. Our clients are done. They want to close the tab... pay the bill.

CoffeeBar Application 17/19 - Serving

Now our staff can see in one look the list of drinks and food to be served, per table number. We have two different events. Let's listen to them.

CoffeeBar Application 16/19 - Get the staff todo list

Food is prepared, drinks are ordered... all they are waiting for is to be served. This is the waiters job. And we do have several waiters in the cofffeebar. So we need to assign the right todo list to the right waiter. We wouldn't assign a tab to a waiter who are not in charge of that table, right ?

CoffeeBar Application 15/19 - Food is prepared, reacting to it

Now food is prepared and ready to serve... The 'foodPrepared' event has been triggered. But we know it well by now, nothing will ever happen if nobody is listening to this event. So now, let's add some listeners... ok, we (almost) know which listeners, but what about callbacks ?

CoffeeBar Application 14/19 - Marking prepared food

The chef knows what he has to do. The list of items to prepare are now displaying on screen. Once the chef has prepared an item, he needs to advise the staff that the item can now be served.

CoffeeBar Application 13/19 - Chef todo list

In our previous chapters, food and drinks have been ordered. Though a drink can be served immediately, food has to be prepared before being served. It is the chef job to prepare food. Today, let's see how to display the chef todo list : what food he has to prepare.

CoffeeBar Application 12/19 - Processing the order

When we place an order, two events are triggered. One event advising the drinks have been ordered and the second event advising the food has been ordered. Based on the initial workflow, the food and drinks do not follow the same process. Let's see how to differentiate each process.

CoffeeBar Application 11/19 - Processing the form

We have now created our place order form, with that nice repeat-my-fields feature in the previous chapter. In today's chapter, we will process the form, binding it to an object and, of course, triggering our events.

Pages

Subscribe to RSS - programmation événementielle