Ruby composition/design quandary -
i trying create convinience method called:
def signin_screen
end
which should have 2 components.
- all common methods devicescreen's signin_screen
- specific methods either android/ios (which determined @ runtime based in env variable)
signinscreen have methods
def emailfield end def passwordfield end
but may have common methods , specific methods.
now androidscreen , iosscreen subclasses of devicescreen. design signinscreen, should class under each of these or module?
please don't add emphasis android/ios/screens etc. person student faculty/staff, need have common authentication class
i don't have experience in specific topic answer based on general ideas.
in opinion, signinscreen serves controller prepare content show, while both androidscreen , iosscreen should nothing more templates. content controller , show on specific device.
by design, signinscreen(or better name without screen since controller or controller action) better nothing devicescreen or sub classes, , better parent applicationcontroller
related reading: http://en.wikipedia.org/wiki/template_method_pattern
Comments
Post a Comment