implement constructor to set attributes in Views