How to start in BackboneJS, if I have a jQuery background? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How can I start in BackboneJS, if I have a jQuery background?
If I am familiar with developing client-side applications in jQuery, but now I want to start with BackboneJS. So can you describe the pattern or model(paradigm) which is necessary ?
Below are some questions that might help you make an answer:
How can I architect and design client-side web applications in terms of JS?
What are the Do's & Dont's?
Is there any server side restrictions for which I have to pay more attention?
I am not seeking for a detailed comparison between jQuery and BackboneJS. I just want to start with Backbone and want to build and think any application in terms of architectural design.

Here is what I find most useful for up and running with backbone.js: Lynda.com Up and running with Backbone.js with Joseph LeBlanc
I think this is the best way to get started with backbone.js for one who has previous experience in Javascript/jQuery. The duration of the course is 1h33m. And here are the contents:
Backbone helps you separate DOM manipulation from the data powering
your web application. In this course, learn how to use Backbone
models and collections to manage your data, while displaying it
through views. Author Joseph LeBlanc shows you how to use events to
change an application's state and avoid messy nested callback
functions. He explores modifying resources on the server side via
models that reflect the changes in your application, tune your
application's performance, and keep the JavaScript environment clear
of excessive global variables. He also covers supplementary tools
based on Backbone that provide additional functionality.
Topics include:
What is Backbone.js?
Starting a node server
Building routes
Creating views
Reusing views and building view templates
Defining models
Loading remote data
Organizing collections
Adding and removing models
Saving and deleting data
Bootstrapping data
Finding Backbone resources

Related

Using react in a legacy jquery + java spring project [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Backstory: My boss has given me the mission to figure out how to implement react into one of our existing codebases. The idea is to use this to test integration and see if we can slowly migrate out projects over to react. As well to demonstrate to those in charge improvement react can offer over jquery. The problem is I only have less than 2 years of web experience most of which is jquery and near zero of that is react. So I'm struggling to learn the process of integrating react. This is made more challenging by figuring out supporting systems like webpack, npm, and varies libs used with react.
Goal-1: Get a single page running react inside an existing layout that can support modules/libs
Goal-2: Get this page to play well with our jquery menu (option as I can rewrite it)
Goal-3: Get everything placed into its respective folders inside our src/main/webapp
Current state: I have a page loading react and babel using simple script tags. This works but is rather difficult getting any other react libs to load. As most assume npm is being used or commonjs at the minimal. Neither of these I have much knowledge with using/implementing.
What I need: Some guidance on how to implement react into an existing project. I've run over a few articles talking about the process but many lack details needed to understand what is going on in each step. For example getting webpack to export into the target directory so it can be bundled for use in tomcat.
Before this ends up closed, my high level thoughts is get your spring project into a state where it is exposing RESTful endpoints for getting and saving your data. Then build the react project separately from the current java or jquery projects, and have the react ui consume those REST apis.
Apart from that, this is a very broad question you are asking, with lots of ways to solve it, the above mentioned is only a starting point. I couldnt possibly go into complete architecture here..

AngularJs or NodeJs or both [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to develop a website using JavaScript/HTML5/CSS3, because it is more flexible in UI. I read internet about AngularJS for the client side and about NODEJS: it can be used to both clent side and server side.
Can anyone kindly inform me about the cons and pros of the following:
use AngularJs for client side and other language for server side (EX : PHP ).
Use NODE.JS for build website
or can I use both?
If you want to check for pros & consof Angular only, here is the list:
PROS
Angular follows MV-Whatever architecture. Hence you can either MVP, MVC or MVVM.
It gives the flexibility to do two way binding. Data binding tries to get rid of writing codes manually by relieving the backend server from creating templates. MVC pipeline is also maintained by the framework itself.
DOM Manipulations at one place: You can make use of angular directives to play with the dom giving a neater code.There are some reusable tags defined by angular folks themselves in directives like ng-class, or ng-show. See Angular Directive Documentation
Test Ready: The fact that AngularJS comes linked with Dependency Injection (DI) makes it ready for unit testing by injecting mock data into controller and measuring the output and behavior.
Ionic Framework: Ionic Framework is written on top of Angular and is mainly used to build hybrid apps. So Angular is useful if you are going to extend your website into a mobile hybrid app.
Cons:
Difficult to adapt the existing code: AngularJS requires the developer to re-implement the entire transformation code which makes it extremely hard to play around while adapting existing code.
Heavy: Their are lighter frameworks like backbone and knockout, however seeing the power of Angular it can be easily negated
Now moving to your question whether Nodejs be used in conjunction to Angularjs my answer to it is:
AWESOME COMBINATION
You can have your server code residing in nodejs and use angularjs at client side keeping the architectures completely different. Since Nodejs also uses javascript there would be less of uptime for developers to learn it and start developing. Infact MEAN (Mongo-Express-Angular-Node) methodology.
Their are various boilerplates available in order to kick start your development. One can be found at MEAN

With HTML5, JavaScript and AJAX, are PHP, ASP.NET and J2EE backends still required? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to catch up with modern Web application design approaches. With the latest technologies, is it still appropriate or necessary to tie a web application to a specific backend language like PHP, ASP.NET or J2EE?
I've been thinking of HTML5, JavaScript and asynchronous queries. An application could potentially consist of a series of simple, empty HTML document templates where the data components are filled in after the page load event using JQuery/XMLHttpRequest calls to a web service.
In this context, the backend web service could be implemented using any arbitrary framework and the serving of HTML pages could be handle by any web server. The application's web component would then be purely HTML5 and JavaScript with all other business logic hidden behind a web service interface.
But is this an effective design for complex applications which rely on session management and page transitions? Does anyone code this way or are traditional backend languages always used to generate the HTML documents?
Thanks.
Interesting question, I view it as this way. HTML5 is no longer HTML5.. but "HTML". We'll never see an HTML6, the new HTML5 model will continue to be improved upon and have features added to it. Some day, the days of needing third party plugins for video, audio and drawing, all devices will share the same front end presentation model.
When you think of it, frameworks like PHP just make dynamic HTML, and marry business logic with presentation logic. For the forseeable future, couldn't we always have a need for something like that? That being said, I can certainly see numerous applications in the future that leverage open data and rich client side controls. I don't think this threatens the extinction of ASP.NET, PHP or J2EE.. I think it enhances them, as now we all have a more fuller toolbox to develop with.
Scott Hanselman gave an awesome presentation 2 years ago at Microsoft's Build conference (http://channel9.msdn.com/Events/Build/2012/3-027), it's a great discussion on how JavaScript makes the web browser an incredible emulator, and that you can now front load logic and programming onto the end user... similar to what you are thinking. In the end, I think options like this just allow us to make sure that we use the tools for the appropriate reasons, just like in the ASP.NET world we now have Web Forms and MVC.. Web Forms aren't dead, they're just not the only game in town anymore, but now we can use Web Forms when appropriate, and MVC when appropriate.
Great question!

Node.js, Express and Mongoose : automatic CRUD API [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Coming from python world, we heavily used tastypie or Django-Rest-framework to create Rest API.
Reading through Convincing the boss from Felix Geisendörfer, i noted the following statement:
Building light-weight REST / JSON api's is something where node.js really shines. Its non-blocking I/O model combined with JavaScript make it a great choice for wrapping other data sources such as databases or web services and exposing them via a JSON interface.
When I try to learn Node.js and find the best way to implement a REST API using existing and reliable modules (like tastypie for Django); I just can't find a node.js module which handle those actions (GET,PUT,POST,DELETE,PATCH) based on a model automaticaly.
You will find a lot of tutorials saying how to implement a basic rest api, but I didn't find module ready to be use in a large production app. (i found Restify , mers ...)
What do you guys are using? Existing modules or you prefer developing your own controllers to handle those tasks and creating your own routes manually?
Check a list of Node.js frameworks, here for example. A lot of them provide REST out of the box.
Take a look at Sails.js, for example. With this one you can create a model and get a REST API within seconds.
As for the production-ready thing, it somewhat depends indeed on your own criteria and the requirements you are imposing.

Best way for JS architecture? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking to build a web app (online simple game) with javascript / HTML5 but I want a structured code.
I have do some research and Angular look like a good MVC framework.
http://angularjs.org/
Have you see other framework ? Angular is it a really good framework ?
Thanks
Edit:
Maintain javascript code is not easy and quickly becomes unreadable without an architecture that helps to develop properly.
I have a simple little web project, players are by team and have some kind of action that infuence the actions of other players.
I want a framework that allows to manage all data easily.
A little way to flex and AS3, ca would be to create the component and integrate easily into the html code.
Backbone js seems to be effective for the data binding with epoxy.
or http://docs.angularjs.org/guide/dev_guide.templates.databinding
I'll do more research because my question is too broad ...
I think this is a very broad question that simply choosing a particular library won't solve. AngularJS is great, but I think it's important to understand how to scale a javascript application. Here is a video of a presentation given by Nicholas Zakas. http://www.youtube.com/watch?v=7BGvy-S-Iag
Another good resource http://addyosmani.com/largescalejavascript/
Knowing these concepts will allow you to build an application that is capable of dropping modules in and out seamlessly. You will be able to change a module without affecting any other module because your program will be loosely coupled. Additionally, should you choose to switch from Angular to something else, this framework will allow you to swap the base library easily and without breaking very much of your code.
Also, using modules and a mediator will make your code easier to test. Testing is important in any non-trivial application. I hope this helps!
If you're looking to just quickly create a web server that can serve your javascript application, I highly recommend Rails. You can get a server up and running in just 15 minutes. Another good MVC framework is NodeJs with Express. Almost as easy to use as Rails and it's purely Javascript whereas rails is Ruby.
Here is a list of common MVC frameworks and you can choose one based on the complexity of you app and data models.
List of common MVC frameworks
if you really want to build a structured App using Angular Js Use the directory structure of ng-boilerplate

Categories