set $view as protected and add getters and setters