stravid/slotcars — pull request #117 by tombu (2012-03-29 19:34:29+00:00)
Title: chore/generalize screen architecture

Like discussed in issue #113 the four screens have some duplicate code. To be more general concerning the views I added a `Appendable` mixin.

The mixin has a `appendView` and a `removeView` method that append/remove the view which is also a part of the mixin but has to be set by the particular screen.
In addition the mixin overrides the `destroy` method so the views are removed automatically when the screen gets destroyed.

Other stuff:
* I left `removeView` public so that views can also be removed by hand. I´m not sure if we ever need it ... so maybe it should be private
* As you will recognize every screen has a private `_appendScreen` method. All those look pretty identical. Instead we could extend the `appendView` method of `Appendable` so that it takes a view and cares for setting the `view` property and appending the view.