Ruby composition/design quandary -


i trying create convinience method called:

def signin_screen

end

which should have 2 components.

  1. all common methods devicescreen's signin_screen
  2. 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

better explanation pen , paper

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

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -