TechnoBuzz

A Techno Blog, mainly about Java

MVC in Javascript

http://www.alexatnet.com/articles/model-view-controller-mvc-javascript

Controller:

  • add an item
  • delete an item
  • update

View

  • wired to listen for add button click, invokes controller
  • wired to listen for delete button click, invokes controller
  • Event (model) handler for itemAdded, itemRemoved
  • sender object
  • attach method to add handler to the event
  • notify method to invoke a handlers

Model

  •  list of current items
  • selected index
  • define Event (model) for item added, removed, selectedindex changed
  • model getters/setter methods for items
Advertisements

July 17, 2012 Posted by | Uncategorized | | Leave a comment