pdo->query($this->isPublicSql, $id); // .....some procedure } } class Page{ protected $id; protected $strategy; function __construct($id, PageStrategy $strategy){ $this->id = $id; $this->strategy = $strategy; } function isPublic(){ return $this->strategy->isPublic($this->id); } } $page = new Page(new PageStrategy()); if ($page->isPublic()){ // ... }