   ###
   Destroy the view after the 'out' animation, the default behavior is to just
   empty it's container element.
+
+  before_destroy will be called just before emptying it.
   ###
-  destroy:->
+  destroy: () ->
+    if @on_resize?
+      $( window ).unbind 'resize', @on_resize
+
+    @before_destroy?()
     @el.empty()
 
-   # ~> Shortcuts
+  # ~> Shortcuts
 
   ###
   Shortcut for application navigate
-   @param [String] url URL to navigate
+
+  @param [String] url URL to navigate
   ###
   navigate:( url )->
     @the.processes.router.navigate url
 
   ###
   Shortcut for Factory.view method
-   @param [String] path    Path to view file
+
+  @param [String] path    Path to view file
   ###
   view:( path, fn )->
     Factory.view path, @process, fn
 
   ###
   Shortcut for Factory.template method
-   @param [String] url Path to template file
+
+  @param [String] url Path to template file
   ###
   template:( path, fn )->
-    Factory.template path, fn+    Factory.template path, fn
+
+  ###
+  instantiates a view, render on container passing current data
+  ###
+  require: ( view, container, data = @data, template ) ->
+    view = @view view, ( view ) =>
+
+      if container
+
+        # if user passes a selector instead of a object
+        if container instanceof String
+          container = @el.find container
+
+        # if user passes an object ref, jQuerify it 
+        unless container instanceof jQuery
+          container = $ container
+
+        view.render data, @el.find container, template
+
+      view
+
+  find: ( selector ) => @el.find selector
+
+  ###
+  Takes a selector or array of selectors
+  Adds click event handler to each of them
+  ###
+  link: ( a_selector ) ->
+
+    $( a_selector ).each ( index, selector ) =>
+      @find( selector ).click ( event ) =>
+
+        @navigate $( event.delegateTarget ).attr( 'href' )
+
+        return off
      @el = $ el

      if template == null
        tmpl_folder = @namespace.singularize()
        tmpl_name   = @classname.underscore()
        Factory.template "#{tmpl_folder}/#{tmpl_name}", ( template )=>
          @render_template template

   render_template:( template )->


  # $ reference to dom element
  el: null

  # @property [String] class path
  classpath : null

  # @property [String] class name
  classname : null

  # @property [String] namespace
  namespace : null
  
  # @property [theoricus.core.Process] process
  process   : null

   ###
  @param [theoricus.Theoricus] @the   Shortcut for app's instance
  ###
