source control & knockout
DESCRIPTION
www.morettocarlo.eu ts.eestec.itTRANSCRIPT
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Client Technology
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
• jQuery• Toastr• Knockout
Client
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Download: http://jquery.com/
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.
jQuery
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
https://github.com/CodeSeven/toastr
Sample:• toastr.warning(‘Warning!') ;• toastr.success('Have fun storming the
castle!', 'Miracle');• toastr.error(‘Please check your data‘);
Toastr: JS notification
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
http://knockoutjs.com/
Knockout is a Javascript library that allows developers to create rich, responsive display and editor user interfaces with a clean underlying data model.
Knockout
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
• Declarative bindings• Automatic UI refresh (when the
data model's state changes, the UI updates automatically)
• Dependency tracking• Templating
Features
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
MVVM facilitates a clear separation of the development of the graphical user interface (either as markup language or GUI code) from the development of the business logic or back end logic known as the model.
MVVM - Model View ViewModel
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
View (HTML)
<p>First name: <input data-bind="value: firstName" /></p><p>Last name: <input data-bind="value: lastName" /></p><h2>Hello, <span data-bind="text: fullName"> </span>!</h2>
View Model (Javascript)
function ViewModel() { this.firstName = ko.observable(‘Mario’); this.lastName = ko.observable(‘Rossi’); this.fullName = ko.computed(function() { return this.firstName() + " " + this.lastName(); }, this); } ko.applyBindings(new ViewModel());
Example
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Example• Control Type
knockoutjs.com/examples/controlTypes.html
• Observable Arrays knockoutjs.com/documentation/observableArrays.html
• Cart Editor knockoutjs.com/examples/cartEditor.html
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Download and save the data
Save$.ajax({ type: "POST", url: "/api/yyy?param=zzz", data: dataJs, success: function (data) { toastr.success(‘:-)'); }, error: function () { toastr.error(‘:-('); }});
Download $.getJSON("/api/yyy?par=zzz", function (data) { viewModelJs = data; viewModel = addComputed(viewModelJs); ko.mapping.fromJS(viewModelJs); ko.applyBindings(viewModel);})});
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Useful links
•https://github.com/CodeSeven/KoLite - asyncCommand, activity, dirtyFlag
•http://www.knockmeout.net - knockout tutorial
•https://github.com/ericmbarnard/Knockout-Validation - knockout validation
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Source Control
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
• TFS• SVN• Git• Mercurial
Source Control
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Compatible successor to the widely used Concurrent Versions System (CVS):
• Versioning of directories• Atomic commits• Metadata versioning• Abstraction from the network layer
SVN
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Git
+ Dramatic increase in operation speed+ Cheap branch operations+ Full history tree available offline+ Distributed, peer-to-peer model- Learning curve for those used to SVN- Not optimal for single developers- Limited Windows support compared to Linux
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Mercurial+ Easier to learn than Git+ Better documentation+ Distributed model- No merging of two parents- Extension-based rather than scriptability- Less out of the box power
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
• http://biz30.timedoctor.com/git-mecurial-and-cvs-comparison-of-svn-software/ - git vs mercurial vs cvs
• http://blogs.atlassian.com/2012/02/mercurial-vs-git-why-mercurial/ - command line git, mercurial
• http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ - Intro to Distributed Version Control
• https://github.com/ - github• http://codeplex.com/ - codeplex• https://bitbucket.org/ - bitbuket• http://code.google.com/intl/it/ - google code
Useful links
Moretto Carlo – www.morettocarlo.eu ts.eestec.it
Email: [email protected]: www.morettocarlo.euEESTEC: ts.eestec.it
Contacts