vendredi 17 janvier 2014

What is Objective Reality design pattern?

Objective Reality is the fact of coding real and funny situations, in an objective and professional goal.
It is a design pattern based over the CSS (Code Similar Situations) principle, that has also been thought by Edouard Kombo.



Concrete Example

Before, to open a file and send it by mail, you were coding like this:
$parser = new Parser();
$mail = new Mailer();

$file = $parser->open($file);
$mail->send($file);
Now, with Objective Reality design pattern, you should imagine a story and code like this:
$torch = new Parser();
$boomerang = new Mailer();

$file = $torch->open($file);
$boomerang->send($file);

Explanation

In the second example, you added a little bit of creativity in your code, that implies a story-telling creation.
That's it, with a story telling, you are now able to play with your code, and help other developers understand more easily the purpose of your instructions.

The structure of your program doesn't have to change, just rename the variables to begin openning a universe that could revolutionnate the way you develop applications and master it.


Advantages

When you play, you except to win something and earn a reward.

By example, you can establish within your team a reward board for every classes tested and developed that will help you estimate more precisely the technical debt of a project.

In all cases, developers will have the illusion to play with something, rather than building a complex architecture.


What kind of story telling to apply?

The goal of Objective Reality is not to apply fancy things to variables names.
There are rules to make it efficient.

The first and unique rule is to apply CSS (Code Similar Situations) principle.
It could be a movie you liked, a cartoon, a real life experience, it could be anything you imagine, but only a situation the largest number of people may have lived.

This will significantly facilitate code reuse of your applications.


To learn more about CSS principle, click here http://le-code-vulgarise.blogspot.fr/2014/01/what-is-css-principle.html.

Aucun commentaire:

Enregistrer un commentaire