quarta-feira, 16 de dezembro de 2015

My PHP MVC good pratices;

About method's parameters:

All parameters passed through during a method call must be, when possible, objects which types are the main type handled by the object whose method are being called. For instance, suppose we have a CommandsModel class that handle Command objects and we want to create and persist a new Command, so the create method signature could look like this:

+ create(newCMD : Command ) : Command

About models:

Every Create method should return the created object;

Nenhum comentário:

Postar um comentário