Spring MVC + Javascript - javascript

Im using Spring MVC. Recently im getting sick of ugly javascript code, debugging, flexibility and maintenance. jQuery is not enought to make me happy. Is there any good framework that can cope with that?

There are several javascript frameworks that you can choose. I would suggest MVC frameworks:
http://www.infoq.com/research/top-javascript-mvc-frameworks
http://jonathanmh.com/best-javascript-mvc-frameworks-2013-2014/
You will be able to provide a better structure in our web applications.

Maybe Angular js?
It's a javascript framework which uses jQuery but it's so much more than that. Give it a look
https://angularjs.org/

Related

Javascript coding guide with test driven development

I'm migrating from server side development (java, php) to client side - HTML, CSS, javascript.
Though I technically understand (mostly) how javascript works, I have not found a good guide to creating an application - particularly with regards to how to organise functions and objects and setting up a solid test framework for them.
I'm currently half way through the Ruby on Rails tutorial
http://ruby.railstutorial.org/
which is excellent - I now feel confident in understanding the standard structure for arranging all the code in an application, and setup good testing practices as I go.
Plus, the integration with heroku and git make for a really tangible real world example, making for a complete understanding of how to develop and deploy a rails app.
Can anyone recommend a similar kind of guide for JS/AJAX development?
One good way to write JavaScript is to do it in a modular fashion. For dependency loading, you would also need module loaders like RequireJS. As for structure, there are a lots of frameworks out there, I suggest you give BackboneJS a try. You would also want to make your JS scalable so that you won't ever have to worry about expanding. Here's more videos about it as well.
There are a lot of frameworks to choose in JS. Test them all out and create a stack which you feel comfortable playing with.
I don't think you'll find a similar tutorial as on Ruby on Rails about Javascript, because Rails is a framework and Javascript is just a language that has hundreds of different frameworks built around it. I don't know what kind of applications are you willing to develop, but Backbone.js is an MVC framework for frontend development and you could search some tutorials on it.
However, if you're just starting out with JS, you probably want to learn first on the basics of JS. Good source for that is for ex. MDN JS guide:
https://developer.mozilla.org/en/JavaScript/Guide
Then you might want to check out guide on JS design patterns for learning how to structure your code:
http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/#designpatternsjavascript
Hope these will help!

ASP.NET MVC how to understand related technologies, javascript, html, css

I need advice. I can understand asp.net mvc/c#, but I feel uncomfortable when I am working with html-css, javascript, jQuery. I can not understand how to mix It all. Can you give some good advice? possible good articles, examples.
I would recommend you starting with the jquery documentation which contains many useful tutorials and examples. If you are saying that you are comfortable with ASP.NET MVC then you already know the markup that is being generated by the different helpers and so applying jquery to them unobtrusively in a separate javascript file is really simple and the same as if you were using some other server side framework. Just try to make an abstraction of the server side framework when working with jquery. Think of it in terms of static HTML markup that you are applying some dynamic actions to.
The following two topics are really important to learn as you will probably be using them most during application development:
DOM manipulation
AJAX
There have been some efforts from the part of Microsoft to abstract javascript into some HTML helpers (known as the MicrosoftAjax framework) so that the developer shouldn't need to know javascript or jquery in order to use them and IMHO this is a disaster. It is leading to mixing markup and javascript and the developer loosing track of what is happening with his application and not knowing why it doesn't work, simply because he learned some leaky abstractions without understanding the fundamental concepts. So if I had an advice to give you is to download FireBug and start practicing jquery with some simple HTML markup.
By the way jsfiddle.net is a great site allowing you to very quickly start creating mockups with jquery, HTML and CSS.
Regarding how to mix it all you could say that html and css is only connected to your views and that javascript/jQuery could be connected to both your views and your controllers (if you use AJAX).
W3schools.com has nice html and css intros:
http://www.w3schools.com/html/html_intro.asp
http://www.w3schools.com/css/css_intro.asp
practice and work more with the technologies, if you have gotten grasp on asp.net/c#/mvc you should have no problem with the other things as well; start reading blogs and books too
Only one way - practice. Practice with books and with mentor is much better.

What Javascript library encourages nice UI patterns and is appropriate for Silverlight/WPF developer?

I have some experience in SL/WPF. I always wanted to learn how to create nice looking JavaScript web apps that would be relatively easy to implement. Are there any JavaScript libraries that would offer nice view/viewlogic separation (MVVM?) as well as potentially a decent set of controls?
Could you recommend anything?
You might want to try http://knockoutjs.com/
It's a binding framework that will enable MVVM in JavaScript.
Everyone should be aware of jQuery. It has become fundamental for browser development. The jQuery UI plug-in is worth a look.

Javascript + MVC + UI

I'm looking for fresh ways of programming in javascript. My goal is to create javascript application like GMail. I tried GWT but it seams so complicated and the code isn't stylish.
I found MVC patteren to be a good way of programming. I always have problems organizing the code in javascript. When I use CakePHP or RoR, everything is simpel :).
I'm looking for a javascript framework that would support MVC way of programming and would have good widgets like Adobe Spry Framework. What frameworks should I use? Thx!
A List Apart has an article about JavaScript MVC. I don't think you should necessarily use a framework, unless you're already familiar with one.
That article also points out to some MVC frameworks:
JavaScriptMVC
SproutCore
TrimJunction
You might want to take a look at Cappuccino: http://cappuccino.org
Check out AngularJS - http://angularjs.org
It will help you a lot with your app structure and strict separation between logic and view.
Full test environment (unit/e2e) and dependency injection included...

How to start up with jQuery in ASP.Net MVC?

I know C# really well, just started playing with ASP.Net MVC a few weeks ago, and almost zero javascript. I saw some people here recomending jQuery, so I'll try that out.
What resources/tutorial should I start with?
Here you go straight from the source:
http://docs.jquery.com/Tutorials
You may want to see
http://www.w3schools.com/JS/default.asp
Learning jQuery is a good place to start.
The jQuery site has excellent documentation and lots of samples. It really is the best place to get started.
For general JavaScript I would read JavaScript The Good Parts
Try checking out Rob Conery's blog post, Putting the M back in MVC. It integrates a pre version 3 of Subsonic, ASP.Net MVC, and jQuery(core, UI, and forms). It's quick and easy to build simple web applications. It will move you up the jQuery learning curve fairly quickly if you are looking at Ajax, forms validation, and some basic CSS twiddling.
The nice thing about this approach is you get working applications that allow you to try different approaches.

Categories