marionettejs/backbone.marionette — pull request #724 by ccamarat (2013-09-16 00:03:40+00:00)
Title: Replace `close` operation with `dispose`

This is a breaking change request.

The `close` operation acts as a destructor for Marionette Views, and destructed objects should not be reused. The name `close` doesn't convey this intention and Marionette's users regularly attempt to reuse closed views. Seeing unusual behavior, attempts have been made to patch individual bugs without fully realizing the scope of the problem. Marionette 1.0.3 contained the first of these partial bug-fixes; it failed to account for all the things that the various types of views do during their construction that would need to be re-done if the view was to be reused, and so the problems persisted. Other pull requests attempt to resolve various problems arising from this usage, but none have fully addressed the problem, and I'm of the opinion we shouldn't try.

I submit that `close`ing s view should truly prep it for garbage collection. To clearly convey the intent of the function I propose that it be renamed to `dispose` instead.

Additionally, since there seems to be a genuine need for swapping views without disposing them, this pull request has added a `swap` method to the Region.