月曜だからデザインパターンでも勉強しよう vol.4 builder

Download 月曜だからデザインパターンでも勉強しよう vol.4 Builder

If you can't read please download the document

Upload: takaaki-hirano

Post on 27-Jan-2017

325 views

Category:

Technology


0 download

TRANSCRIPT

vol.4Builder

Builder

class Director { private $builder;

public function __construct($builder) { $this->builder = $builder; }

public function make() { $this->builder->preprocess(); $this->builder->execute(); $this->builder->postprocess(); return $this->builder->getResult(); }}

interface Builder { public function preprocess();

public function execute();

public function postprocess();

public function getResult();}

DirectorBuilderBuilder