4 ms·
Could you explain some of the reasons for needing a client side framework for a web app? I've always just used requirejs and wrote modules and that has worked f
by ocfx 13y ago
Could you explain some of the reasons for needing a client side framework for a web app? I've always just used requirejs and wrote modules and that has worked for me as I try to keep as much server side as possible, but I realize my experience in the industry is limited so I wanted to hear some arguments for client side frameworks. I've been flamed in a few freenode channels just for bringing them up.
- jaxytee 13y agoThe Mode View * client side frameworks help to separate concerns of storing the data relevant to your app (models), creating the abstractions responsible for displaying the models to the user interface (Views), and managing the routing of your app (* or sometimes called controllers) within your application. These separations help to make code in your application more reusable, easier to debug, and easier to modify.
- deleted 13y ago[deleted]
- digitalzombie 13y agoI'd like to answer this. You're separating layout logic/codes to client side. Not only that but your server side code is now basically a web service, usually Restful. So it's real slim and all it does is serve data. And your client side will be the one responsible for rendering the data. This also may forces your layout code to be front end, which people can steal, but it put more emphasis on the value of your data. Then again you can steal webpage design css/html all the time... likewise with javascript anyway. And another reason for using client side MVC is because they want their web application to act like an application and less of a webpage so you'll hear the term single page application a lot. It's a whole a trend, they created AJAX so it's less like a webpage more like a web application. Of course it depends on your project/website and it requirement and if it's more like an application or more of a website. There are some drawbacks to this, SEO namely for angular but you can have work around like phantomjs. Not so much for ember.js (I'm about to learn ember soon...).
- ghc 13y agoImagine you're building a desktop application that does something like take a bunch of sensors from an attached serial port device and displays configuration of them + a table of their values updating in real time. You wouldn't create every GUI element from scratch. You'd use the built-in Windows components (these sorts of apps are almost always windows-exclusive). Now imagine you're building a web app that does the same thing, except now it's hosted on the embedded system and you get to it via web browser. You're going to want it to behave like a desktop application. Adopting client-side GUI frameworks like ExtJS was so common you wouldn't think twice about it. The reusable components make it much closer to a desktop application than a website. If I were still building applications like that, I think I would still use ExtJS, warts and all. It's perfect for table-and-tree-driven application. Nowadays, if I want to build SPAs, I use AngularJS. It's hard to overestimate just how much of a revelation that kind of client-side framework is. TL;DR - In industry you often can't keep much server side. Instead you have to talk to lots of services and APIs directly from the browser. Additionally, you may need standardized GUI components that are familiar to people who only use desktop programs for the most part. Those two areas are admirably served by client-side frameworks like AngularJS in the first instance and ExtJS in the latter.