python - class definition dependence on runtime -
in webapp made 2 different sessionhandler classes inheriting class called sessionhandler
now i'd initiate appropriate handler (dependent on cookie value.)
background: sessionhandler should base class of controller needs call controller backend method otherwise assign handler object ctrl member
is there way set superclass @ runtime?
or other way solve that? hope got meant!
i not sure entirely understood question, sure need use inheritance? couldn't class need member instead?
changing superclass @ runtime not sound design, if @ possible.
just sure got you, want have controller inherit 1 of sessionhandlers, select 1 @ runtime? rather make controller have member variable of type sessionhandler.
Comments
Post a Comment