OOP

Retour vers le futur ? Jamais !

Après une discussion tout a fait cordiale avec un ami, v'la qu'il me dit qu'il ne comprends pas cet engouement pour le développement orienté objet et que finalement, il y a tout un historique avec la programmation procédurale, que ça a très bien fonctionné en son temps et que finalement, on peut tout aussi bien faire en procédural ce qu'on peut faire en objet.

Utiliser les tags du container pour vérifier l'état d'un ensemble de services.

Dans mon application, je souhaite vérifier que tous les objets que je stocke en session sont tous correctement initialisés. Si au moins l'un d'entre eux n'est pas initialisé correctement, je dois faire une redirection dans mon controller. Voyons comment je peux m'en sortir avec les tags du container de Symfony.

Sérializer un objet

En français, on dit linéariser... Voyons comment on peut stocker un objet.

Tags: 

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.

Pages

Subscribe to RSS - OOP