Follow on Google News News By Tag Industry News News By Location Country(s) Industry News
Follow on Google News | ![]() Knockout and AngularJS now are so-called competitors, and we have to make a choiceDiatom Enterprises team have successfully delivered a serious Knockout JS based project for our Latvian customer.
As written on the official website "Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model." So basically it is a framework that presents a very simple yet useful data-binding for web-applications on the side of a client, but not more than that. KnockoutJS is very “easy” and fast, but it does not imply such rich possibilities as Angular. The application we developed for our customer has quite a difficult and “heavy” back-end. Almost all data processing is concentrated on the server side, including validation of forms. At the same time the front-end is rather simple, it does not require any complicated dynamic data interaction on the customer’s side. In this situation all possible advantages of AngularJS would not be used. That’s why we made quite logical decision to use more simple and “easy” Knockout. 2. Do I understand you correctly? The main reason for this choice – the requirement to have more simple and reliable method to quickly develop forms according to specification? Yes, absolutely correct. If we require some complicated “rich” functionality on the customer’s side, especially if the interaction between the forms is required, it is better to use Angular. If the forms are relatively simple, Knockout is the best choice. 3. How many forms approximately have you implemented? On this project we have developed about 300 forms. The client refused to spend time and money on Unit tests. To my opinion, refusal to make tests on projects of middle and large scale does not serve well, because in spite of some economy at the beginning stage of development, lack of tests makes the project’s further support and development extremely difficult and expensive. The difference of developing web-applications with Knockout from traditional is in preparation of View Model, which later is linked to markup elements through the data-bind attribute. Herewith, View Model apart from its own data can also contain validation rules, subscriptions to data change, etc. 5. What did you like about KnockoutJS and what you did not? I really liked about Knockout that it’s simple and easy to learn and develop, on one hand, but on the other hand the flexibility and gracefulness of incorporated solutions. About its faults I would say – if there are any problems on the project (difficult to implement something on Knockout or there are productivity problems), then probably Knockout is not the instrument to be used in this particular case. I did not face any problems when Knockout was used to complete the tasks it is designed for. 6. In the project that I was talking about – we are responsible for the choice of platform. There are not so many forms on the project, but these forms are rather complicated. We’ll have to implement the tabs switching, several tables on one form, editing of tables, and validation on forms. What would you suggest in this case? For complicated forms I would recommend to use some fully-featured MVC framework, for example AngularJS or Backbone, because the options of Knockout may not be enough for such functionality. 7. I did not mention the back-end in my questions so far. What server technology was used on your project and why? For web platform the ASP.NET MVC5 framework was chosen, but interaction of the client and server was done by using SignalR, because the project required the interactive communication between the client and the server, calling the client’s code form the server, etc. As a DB (database) server the MS SQL Server 2012 was used. 8. SignalR – it is a separate and also quite interesting topic. Sergey, can you tell which advantages of this technology were used on your project? On our project we used the basic advantage of SignalR – the possibility of interactive two-way communication between the client (browser) and server. Due to technical peculiarities of the project it was necessary to emulate the work of desktop application in browser. However, due to limitations of HTTP-protocol it was extremely difficult to do using traditional approach of developing web-applications. But SignalR really saved our time and resources during completion of this task. 9. Connection of ASP.NET MVC5 – SignalR – KnockoutJS. Are there any obvious disadvantages? I cannot mark any substantial disadvantages. I would only like to turn your attention to two issues connected with using SignalR: • SignalR does not provide any authentication or authorization mechanisms, that's why this task will have to be solved by additional means (read more here http://www.asp.net/ • SignalR is not designed for transmitting of large volumes of data (for example when on your form you have a big table with many lines), you should take this into account while doing application design, and in such cases provide some mechanisms of data spooling on the form. 10. Thank you for your time, Sergey. You helped us all to know more about SignalR, KnockoutJS and their peculiarities when choosing architecture for business-applications. I personally understood that AngularJS and Knockout are not competitors, but provide implementation of somewhat different tasks. The last question: You have 8 knockout js developers in DiatomEnterprises team. For some of them Knockout was a new technology. How many weeks, to your opinion, were necessary to get to know the technology and start fully functional and effective software development? If we speak only about KnockoutJS, having basic knowledge of JavaScript and HTML we can count the days, not weeks. One of the advantages of Knockout is its simplicity, understandability, good documentation with examples, support from developers’ community side, many examples on field-oriented resources. To my opinion, two-three days are completely enough for advanced usage of KnockoutJS in real projects. Visit http://www.diatomenterprises.com/ End
|