qboql39f4q1h50ufaecrgqs6m71433376404

The web developing is changing every day, a few years ago until these days a lots engineers suggest that the MVC pattern is the best option to face a software problem. Also, the pattern afford us more maintainability, code standardization, portability and others advantages. However, the MVC is evolving in new patterns, such as MVP and MVVM (now, the last one in my research focus). The purpose of this essay is to define KnockoutJS library and answer what for? why? and how can you start?

Firstly, KnockoutJS (ko.js) is a simple javascript library. As a consequence, you only need a web-browser and a text editor. In fact, it is a simple file which can be include in a website or a web application. Also, ko.js has a specific namespace, it means if you add the file in your project it won’t affect project behaviors. Due to ko.js does nothing until you write code to use it. Going back, this library implements the MVVM pattern (Model – View – ViewModel) and that is the reason which was created for. Importantly, this pattern suggests separate user – interface logic from the business functions for software testability purposes.

Secondly, in just five steps you will ready to start developing with ko.js:

  1. Yo will need a web – browser; I recommend you use Chrome because debugging is faster with this plugin, a text editor, a basic web server (apache, nodeJS, IIS).
  2. Create the next folder structure and add the basic HTML structure in index.html (check the repository): 
  3. Download ko.js (CDN version & javascript file)
  4. Add ko.js in project (I will use CDN version) and create App.js in js folder, it will content the namespace.
  5. Run server.

To conclude, I just summarize some points. First, ko.js is a mvvm framework, so it is important to know this design pattern. Second, this library is just a javascript file and use an specific namespace and finally the web server does not affect this library.

Download source code