Web application with backbone.js and requirejs packages, requirejs optimizer [closed] - backbone.js

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm very grateful for Addy Osmani and Thomas Davis for publishing their examples and boilerplates
(http://backbonetutorials.com/organizing-backbone-using-modules, https://github.com/addyosmani/backbone-aura).
They were helping me a lot to get starting.
I'm currently developing a large web application. So I have a lot of components, for instance address management, date management, todos. Each component fills the whole space in my app (with the exception of the menu bar). Each selection of a new component in the menu requires a page transition.
In the beginning I took the file structure, boilerplate used by the tutorials above (giving all views to the 'views' directory). But as more components were added, putting alle views into one views directory became confusing for me. Even making subdirectories would be no solution, because in this file structure I lost the information which view is related to which model.
So I searched for another solution and found requirejs amd packages (http://requirejs.org/docs/api.html#packages).
This helped me alot since all modules belonging to the same component (models, collections, views) came into one directory. Because postfixing every model with "Model" (and so on), things where clean enough for me.
Now to the question:
I'm in the pre-production stage. I did not get into building and concatenation things together for production deployment. But now I want to try the requirejs optimizer.
I have read the page "http://requirejs.org/docs/optimization.html" from James Burke. But not everything is clear to me.
Want I want is the following: I have these package directories. All the amd modules (views, models, collections) from one package directory shall be concatenated to one file, but their dependencies should not be included, as a lot of these outside package dependencies are loaded separately in the beginning.
Is there anybody with the same or similar requirements, who has already taken this step and can give some hints.
Thanks a lot
Wolfgang

You can take a look at these couple of boilerplates and see if they are helpful...
https://github.com/jcreamer898/RequireJS-Backbone-Starter
https://github.com/david0178418/BackboneJS-AMD-Boilerplate
https://github.com/swbiggart/node-express-requirejs-backbone
A few of those have build scripts in them to show you how that works.

Related

Angular JS: what are the problems/ pitfalls of using Angular? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
What pitfalls/ problems/ pains might I expect as I start building real and more complex apps with Angular ?
I am at a new job and about to recommend Angular (and Bootstrap) as the basis for building all our web apps. After nearly 1.5 years of working with backbone.js I know I don't want to use it... We have a Node + MongoDB back end and no real investment in any client side stack. One unique thing is that we have some big data - one collection that will reach 10's of gigs in size with hundreds of millions of records... I have been reading up on and playing with Angular for past two weeks or so and haven't really found anything bad about it.
There is really no pitfall :)
On to a likely less zealot explanation: AngularJS is (as far as I've been able to tell) a lot more opinionated than backbone - most processes are dead easy to perform (displaying data, processing interactions) but follow a somewhat stricter pattern to do so. Supposedly it makes angularJS harder do bend to your specific criteria than backbone, but I have found it isn't so. Also, the few shortcomings of the system are quickly disappearing, as it is evolving crazy fast.
Point in case: the routing system is one of the lesser aspects of angularJS, as it is generally not very flexible (no route inheritance, no state machine)... I started making apps using a workaround that turned out to be quite clean, explained here. However, the folks at angular-ui have come up with a solid solution and a similar solution is bound to appear in angular itself.
The animation directive was also a shortcoming (animating the appearance and disappearance of objects is tricky, as they need to exist up until the end of the animation, and that has to be managed) and has also workaround solutions, but a core animation system was introduced in the 4th of april in angular 1.1.4, here, so you see, it is rapidly evolving :)
Regarding learning curve: it has some, but nothing someone with your experience can't handle in a very short time. This series of video tutorials is the best resource i know of, as an easy way to understand the gist of most things (the documentation is good enough and getting better, but lacks applied examples in some places where it would really helped - or lacked, they may be better by now - also, the "beginners tutorial" is dreadful, I personally hate long running, step-by-step tutorials)
Hope it helps!

backbone.js noob confused by conflicting tutorials [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm new to backbone.js and am working my way through some tutorials. I've found a couple that seem good, but there are some inconsistencies in how they implement so I'm looking for a little guidance on best practices.
Here are the tutorials I'm learning from:
http://www.jamesyu.org/2011/01/27/cloudedit-a-backbone-js-tutorial-by-example/
http://coenraets.org/blog/2011/12/backbone-js-wine-cellar-tutorial-part-1-getting-started
My questions are:
The first tut makes use of Backbone.Controller but not Backbone.Collection. The second does the opposite. Which is the best practice for the "C" in backbones spin on MVC?
The first tut defines urls in the Model, whereas the second defines it in the Collection. Which is the better practice?
The second tut makes use of Backbone.Router, while the first one does not. Which is best practice?
Alternatively if someone can suggest a better intro tutorial that follows best practices I'd be happy to learn from there. Unfortunately because of the inconsistencies between these two, I'm concerned I might be learning some bad habits out of the gate.
Thanks in advance.
Backbone.Controller was renamed to Backbone.Router last year. I guess you were reading an old tutorial.
BackboneTutorials.com is a decent tutorial for getting started.
Build a small app as you learn and you'll know what Backbone does for you.
The best way to learn Backbone is to go through the annotated source code. Each and every line is commented and explained.
Use the dev version instead of the minified version when building your app. This helps in debugging.
If you are into reading books, check out Addy Osmani's Backbone Fundamentals, a free e-book. The book is awesome, but quite verbose. You can use it as a reference.
See this question on Quora for the definitive list of resources;
Don't worry too much about what's 'V' and what's 'C' and backbone's spin on MVC.
The framework does an excellent job of separating code that interacts with the server and the code that performs the core client logic. Templating and updation of DOM Elements is left to you. It's pretty minimalistic in that sense. Backbone provides Events that make the different parts interact with each other.
this is a good question. Though, Backbone isn't taking position on how you should organize your code.
So, the real answer is: it depends.
It depends on the need of your application and how you're used to program.
If you want an overview of some best practice, I'd refer you to the Backbone Boilerplate project: https://github.com/tbranyen/backbone-boilerplate
This project is pretty solid, and really helped me out when starting.
Then, to answer your question (this may feel opiniated, and it is indeed):
1: Backbone is mostly an MV* framework (Model-View-Whatever). Controller logic mostly live into Backbone view, and this is OK for front end developpement as logic is often really tied to the UI (as we are mostly coding interfaces). Backbone isn't coming built in with controller, but if you prefer this type of organization, just build your own.
2: Urls depends on your need. If you're fetching a full collection, set it up on the collection, if you're only fetching (or probably saving) one model, set it on the model. These too live well together.
3: About Router, if you're building multiple pages/sections on your app, use them. But beware of not using routes as action as you would do in RESTful APIs, this will most of the time brings problem eventually (user press back button, etc). So, use routes if you want to manage pages.
Hope this help !!
I will answer from experience:
Q: The second does the opposite. Which is the best practice for the "C" in backbones spin on MVC?
A: There is no Controller in current Backbone http://backbonejs.org/ - "C" happens either in View (most cases) or in Router (see below).
Q: The first tut defines urls in the Model, whereas the second defines it in the Collection. Which is the better practice?
A: There are cases when you don't need collections. In case when you don't, your model absolutely needs a URL. When you do have a collection, URL you specify for Collection will apply to its models.
Q: The second tut makes use of Backbone.Router, while the first one does not. Which is best practice?
A: Rule of thumb - you want to use Router in 2 cases: 1) when you want to have history, and 2) when you want to have permalinks. Otherwise you don't really need router.

Need a good book and sample application for doing a cloud-web-mobile app using Grails, Html5/JS and Google app engine [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
After years /decades of using tasks managers: Lotus Notes, Outlook, Palm (that was a good one), etc.. and now using Appigo, after using Toodledo, a friend of mine and me (both programmers) got tired of how far are all those from our personal GTD style and we decided to build one, something that we can customize as much as we can moving forward. We will do it open source open to public.
Appigo and Toodledo a great inspirations from a functional and technological point of view. We like the server on the cloud, the clients on browser and mobile platforms.
We have been thinking this for a while but when we saw Grails and did some of the tutorials, coincidentally on the task manager subject, we said ‘great, we can use this technology to build ours, this sounds cool’. (at least for the web part and the model, the core part).
Following Appigo strategy also, we plan to use Google App Engine for hosting the back-end.
On the mobile side, since we do not have time for hard core objective-c and stuff and we have a decent experience on Javascript frameworks we decided to use the now popular HTML5/Javascript approach and we think we decided for Sencha but any other Framework may be fine (Dojo, jQuery, etc).
Not surprisingly, our mobile and web clients will communicate with the server primarily using REST and we plan to have a server-side MVC (Grails) and a client-side MVC (like Sencha or Dojo propose)
We do not want to bother too much about databases, we love the Grails idea of creating a model-driven objects and storage.
Our project will be open source and hosted on github for anybody to use it.
Ok, here is the actual question:
Do you guys know good books or sample apps or articles that can help us go through this end-to-end. Of course we could go alone, but we will greatly enjoy going through some books, tutorials first to glue of these things together, decide good patterns to use, learn tips, experiences..etc. We do not have experience with Grails. (but a lot of java and javascript web development), of course I can find books about Grails but we want something end to end, with a good sample focusing on practices and patterns.
Basically a book or article that somehow touches part of this topic “good practices and experience building something like a task manager that runs on Google cloud platform, has the server side done with Grails and the browser and mobile clients using robust HTML5 javascript frameworks”.
Can anybody point us into this?
Thanks!
I have done a couple of engines that are build using grails + the google app engine. My experience is that you are going to have to build up the knowledge thought actually doing the work.
It's very easy to start out but once you get about knee deep there are some very interesting problems that can crop up.
Now that being said the main resources that I have found useful are the following:
http://shop.oreilly.com/product/9780596522735.do
http://www.amazon.com/Groovy-Action-Dierk-Koenig/dp/1932394842
http://www.manning.com/gsmith/
https://developers.google.com/appengine/docs/java/overview
The link above gives a good java over view. But you will need to be able to distill that down to groovy.
http://www.grails.org/plugin/app-engine
and finally www.google.com
but i found that most of the blogs out there are dated to earlier version of grails. And a lot of the issues they were seeing have been fix in 2.0 or are no longer issues at all.

Tiggr vs Application Craft [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
in the last months the development of mobile apps has become more and more a focus of mine. I already created a few apps with PhoneGap and also dived in into mobile frameworks like jQuery Mobile ans Sencha Touch.
In a next step I would like to use a mobile apps builder and I stumbled on Tiggr and Application Craft. There are probably even more.
So I wanted to ask if some people here already have experience with those two or maybe even another app builder and share it with us. As both seem to cover the same area and I am not so interested in learning them all. I would like to know if someone can tell me which is "better".
I know that there has been a big topic about PhoneGap vs Titanium Appcelerator that helped me a lot so I hope I can get some helpful answers about this topic as well.
Thanks for reading,
Marvin
I have been using Application Craft for about a month (on and off) and so far i'm really impressed. They seem to be putting LOTS of work into it: things have broken only a couple of times, never anything serious. Also, they are building really thorough documentation, etc. they host the apps for free, and they seem to be adding features etc all the time. I would bet that in a year or so they will be huge; quality services on the net tend to grow fast thankfully.
I hadn't heard about Tiggr until now. From what i can see on their site, it looks as though their free service is far inferior to what Application Craft offer. They may be worth a try too?
Hope that helps
I haven't specifically tried Tiggr or ApplicationCraft, but as you've already mentioned there are quite a few different app creation systems out there, all of which work in slightly different ways. Many, for example MobileRoadie or AppBaker, supply a series of pre-built templates that you can customise and plug together in various ways. This is great if their templates support the type of app you want, but there's often no scripting support so if you want something custom you need to pay for their developers to add the features you need, or you should go elsewhere.
If you want complete control over how your app looks and works then you should use a more IDE-like system with built-in scripting support. Things to look out for in such a system would be a good code editor, a way of immediately previewing your app inside the tools, decent documentation, support, and examples. If you're planning a cross-platform app, you'll want a system that can simulate your app running on different phone screen sizes, so you can tune your GUI appropriately.
AppFurnace is a new cloud-based app development platform that provides all of the above (I should point out that I work for AppFurnace, of course).
Tiggr Mobile is a great service! Check out thier tutorials on creating an app that will run on any mobile device at http://blog.gotiggr.com/. They've also received good press and have an impressive gallery of apps that users have created and submitted.
You should probably put NS Basic/App Studio on your list as well. It provides a complete IDE, including a 'drag and drop' interface for adding elements to your forms. The overall feel is something like Visual Studio. You can program in JavaScript or Basic. More info at http://www.nsbasic.com/app.
(disclosure: I work for NS Basic)

Tagging file system instead of directories? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
In the modern file systems there are files and directories. In a directory, there are sub-directories and files.
My question is, wouldn't it be better if all the files were in one place, and each file could tagged? So each file have tags, just like in Stack Overflow: every question has tags. The main advantage, is that searching could be much more faster.
What is your opinion? For you, was it more comfortable?
Having developed my own tagging program http://www.taggtool.com I can offer the following thoughts:
It is super useful to be able to cross-reference multiple files using tags but
it involves a lot of upfront and ongoing effort to add tags to your files although automatic rules help.
Technically on Windows it's a challenge to code such a system, where do you save the tag metadata? Ideally in the file but that's only possible with a tiny set of file formats.
Alternative Data Stream offered a possible solution but it feels like a half baked solution.
The other option is to store the metadata in a database which introduces the new challenge of keeping everything in sync.
It's a shame that the native OS doesn't provide a robust metadata storage for files but that's the way it is at the moment.
Hmm. Current research goes into this direction. For example tracker
or WinFS.
Personally I believe that we cannot easily resign from directory structure as:
It is tightly connected with how computers file systems works and what programs expects
Hierarchical organisation helps manage large number of files if there is strong separation. I.e. I have folders Projects, Music, University etc. which shares no files in common
I guess that semi-power users (like *nix geek on windows) need to know the underlying structure easily. I gave up when I tried to do 'search for file XYZ.exe and delete the folder containing it' using standard tools in Windows 7.
On the other hand tags function better when the sets overlaps like:
Photos of family, photos of buildings - where photo of my parents in from of monument belongs?
Music
Questions
If user is 'power-user' enough he might want to use hierarchical tags and form some ontologies. Those on the other hand can be simulated on *nixes by symlinks.
To conclude - in certain areas I prefer tags but not for all of them. Sometimes I need to know underlying structure. But probably as most other stackoverflow users.
File system tagging would be useful - not as a replacement, but as a complement of a directory system. I don't want to have all files in one directory, but I would like to have some files or directories inside a tree hierarchy (like image/video/music collections) organized using tags.
I've started a project to develop a tagging filesystem. Check it at http://code.google.com/p/labelfs/
You may take a look at Reggata It's a simple tagging system for local files.

Resources