Dojox/app for desktop applications. (Dojo 1.9) - javascript

So far in my Dojo web applications I have handled the main application flow by separating all of the high level views (ex: home, search page, admin page, etc) into widgets and changing views by adding them to a all-encompassing widget that contains the entire application and swapping out the display css property ('none', 'block') of the high-level view widgets.
This works, but seems clunky.
I have started looking into dojox/app, but it seems more suited for mobile development.
From the dojo reference guide:
dojox/app is an application framework designed to simply configure through a configuration file an application formed of potentially nested views and to facilitate the transitioning between those views based. Its main current targets are mobile (phone & tablet) devices but it is not restricted to this and can be used for desktop applications as well. Thanks to dojox/app the applications are easily configurable and buildable for easy and fast deployment
Perhaps someone with experience could lay out some pros and cons for using Dojox/app in desktop applications running in the browser?
Or other more formal alternatives to handling this (view switching in particular) manually?

The main reason (I think) that the dojox/app library mainly focuses on the mobile aspect is because the mobile community actually needs it more than a desktop environment. Usually when developing mobile apps you will use a multi-page structure due to the screen size (for example a list page, a detail page, ...). While desktop applications can rely on using a single page (and then the dojox/mvc framework alone will work as well).
The dojox/app library includes many application level APIs, such as navigating between pages (controllers/views) while dojox/mvc mainly focuses on the Model, View, Controller part.
However, dojox/app will work fine on a desktop environment, the most important change will probably just be the view, but the technology behind it doesn't change.
If you're looking for a list of pros/cons I cannot give those, the only thing I can come up with is that there are not a lot of examples on the web about using dojox/app on a desktop environment. Even the reference guide is not up to date (as it is still using data stores which are deprecated).
I don't think there are other alternatives inside the Dojo toolkit (certainly not if you're looking for view switching), you could use dojox/mvc but it means you will have to do more things by yourself. But there are plenty of JavaScript MVC frameworks on the web (AngularJS, Ember.js).

Related

Porting a spring+Blazeds+flex app -cofused in choosing a complete server side(vaadin/Gwt etc) or html5 and JS based approach

We have a Web application which is written in Spring+BlazeDs and Flex. Since flex is involved, it needs an plugin download and does not work on mobile devices.
We want to rewrite the application with following goals:
We do not want to change server side code -we have transaction
services, security, aspects and many features leveraged from Spring
and is quite stable. It has been written in a very decoupled manner
and only data is send over to Flex to work upon -so changing UI
should not require any change in server side
It should work across devices, iPads, Tablets, Mobile and PC
Flex provides very rich UI -user should get similar experience
Easy to learn, use and maintain -yes, this is one of primary requirements as we have
short cycle for supporting the Mobile apps
Separation of UI and Core server logic
Our team background: Mostly java background (who 'learned' flex), little exposure to JavaScript frameworks and HTML5.
Some evaluation :
Framework like Vaadin/JSF/Wicket which have "everything" at server side -even the UI. Our primary concern
a.> Ui code and server code will get mixed up. If we want some UI designer to work independently on components -not sure how it will end up! Do they provide such rich set of components that This might not be required at all?
b.> Will it work across browser
HTML5 and JS frameworks as Angular
a.>Even with Aptana and webstorm IDE, coding and debugging in JavaScript seems challenging -may be because we all are not that experiences there
b.>I saw Vaadin sampler page and it provides really rich set of UI component and seems to be a RAD model in true sense .. do we have similar frameworks for html and js?
We went through resources on Web, nice comparison of Java based web frameworks http://zeroturnaround.com/rebellabs/the-curious-coders-java-web-frameworks-comparison-spring-mvc-grails-vaadin-gwt-wicket-play-struts-and-jsf/9/ But we are confused with the strategy -A complete server side framework or Server(SpringMvc)+HTML5+JS kind of framework.
I an inclined towards a vaadin based approach -if it supports mobile devices out of box and provides a really rich UI and theme that custom development might not be needed at all -Both of these can be validated by some one having long term experience with vaadin
==May be I should narrow down my question -does vaadin supports all devices (ipad/mobile) ..etc of box and runs in any given browser seamlessly?

Providing no-js fallbacks for clientside MV* frameworks

I just recently got introduced to MV* frameworks and have taken a chance to try out Ember.js with the TodoMVC app tutorial they have on their site.
I was considering using Ember for one of my upcoming projects (a Ruby on Rails CRUD app, similar to Twitter in some of the functionality), but I'm still a bit confused and before I take a final decision I would love it if somebody could clear the following concerns:
Is it a good idea to use such an advanced framework as Ember for a medium-sized multi-page CRUD app? Will it improve development time and maintenance compared to an interactivity layer built with jQuery's DOM manipulation and AJAX capabilities? Or is using Ember (and the like) only good when developing complex single-page apps (e.g.: Grooveshark)?
Considering the app will be developed using Rails, and assuming Ember will be used, is it going to be possible to offer a fallback with basic functionality for browsers with JavaScript disabled and/or for search engine crawlers? Will it require code duplication or other dirty tricks? Do you know of any technique that can be used to achieve it?
Will it be possible to adapt the website for mobile browsing (using only CSS) with valid results, or will the overhead imposed by running Ember on the phone make it hard for the device to render the website in a way that keeps it responsive?
We're in the middle of a pretty big Ember project right now, so here are my thoughts on your questions.
We've found Ember to be really productive for creating rich UIs for our single page app, but I don't know that it's going to be that much more helpful if you're creating an app designed for traditional multi-page (viewing pages, submitting forms, etc) layout.
I think this is the clincher - Ember is completely JS-based, so if you need to support browsers without JS, you'd basically have to write a parallel application. If this is a hard requirement for your app, I think Ember (or any MV* JS framework) would be out of the question
We've had very few performance issues on mobile - our site is fully responsive and renders on everything from Blackberries to the latest Chrome on desktop with good performance.
#Scott Rankin, has addressed most of the concerns with going with the Pure Ember approach. I'll add one quick way to make this decision.
Go with Ember/MVVM if the application is behind a login. Then you don't have to consider search engines, as the content is generally private and not supposed to be indexed.
For SEO you have to build atleast part of your content such that it is indexable. A good example of this is the Discourse application. They use Ember but also send down some generated html along with the app html slugs, so that search engines can index them. You can read about their approach here.
We have a different approach which can be seen as a fall back: We pre-render a static version of each page in the application (daily scheduled task). This static version is stored on the server as HTML file. Whenever we sniff as spider/ robot user agent, we deliver that version.

Considerations on loading speed with AngularJS one page app

The argument of one-page app with AngularJS is not clear at all to me. Specifically
why should one prefer one-page apps over standard implementation?
is there any free service that will turn multiple-pages app into Android app?
opting to go for one-page app (as they show in their beginner tutorial) what's the best way to implement it so that the website/app (inclusive of User Panel ecc) doesn't become really slow in phones? Loading controllers only when they're called will help significantly? Is there a relevant page in their documentation on how should an app be implemented in multiple pages?
It really depends on what you want to build, if it's a website, then probably SPA (Single Page App) is not for you, but if it's a web application then SPA is aimed to give the user a more application like feeling (especially when its intended to be used on phones or tablets and wrapped with something like Phonegap)
Not sure what you mean, if you want to take an app written with JS/HTML/CSS and make it native on Android/IOS etc. then up-mentioned Phonegap will do the trick.
If you mean that you want to make a multiple page app to a single page app, then NO, there is no service like that, you'll have to manually do it.
This is a very complex question and has a lot to do with the way you code and what you build, but you can look here or here for some pointers

Downside to extjs "iframe architecture" (should I refactor to MVC pattern?)

I have an existing intranet webapp (solely internal) built with ExtJS using an "iframe architecture", i.e. it has a top menu and a tabpanel on an index page and about 30 other separate webpages that open as iframes "tabs" inside the main tabpanel.
There is not any particular reason to use iframes, everything is on the same domain and most of these other seperate pages are written using the ExtJS library almost solely in javascript. The html on almost all of them consists of empty HTML, HEAD and BODY tags.
I would really like to refactor this using the ExtJS MVC architecture and ditch the iframes but because "everything works" I can't justify taking the time to do this.
One thought I had but haven't been able to test is: with every one of these separate pages having it's own Ext.onReady event and viewport, etc, this webapp must be loading the full ExtJS framework for every iframe-tab it opens, seriously magnifying client resource usage. Can anyone confirm that this type of architecture would do that with the ExtJS framework?
Is there any other very solid reasons this should be refactored?
Or, would refactoring to MVC architecture only give me easier code maintenance and no performance boosts? (being that currently everything works as intended)
Unfortunately I don't have project similar to what you have handy so I can't test it myself but here are my 2c... :)
I do think each page will initiate its own copy of ExtJs framework but I think it only has an affect on CPU and memory usage. Network traffic should not be very different as core ExtJs files will be cached.
I do recommend to check out network traffic while running this app as you will see how exactly browser handles all this. You might want to add some additional logic into core ExtJs functions to confirm if framework is in fact instantiated several times.
If end users experience some performance issues - it might be very good point to justify re-factoring. Otherwise it's kind of hard. Unless of course you have some plans of expanding functionality in near future and planning on continue working on this application.

PhoneGap Javascript Limits?

I'm looking to create a cross platform Mobile App and have been looking into Developing using PhoneGap. I'm an amateur programmer and most of my knowledge is in ASP.Net and C#.
Will only being able to use HTML, CSS and Javascript with PhoneGap limit me to specific functionality of my App? and would migrating to HTML5 help in adding more functionality to an App?
I'm looking to be able to Populate Drop-Downs from a Database, Add/Edit/Delete Items from a Database, Create Reports Ect...
Your only real limitation as far as data access goes is that you're limited to an SQLite database, which to be honest isn't much of a limitation since it performs great for single-user access.
The short of it is that you have access to a database from within your app, so you can do whatever you need to. The tools are HTML & JS as opposed to C# with some graphics layer, so doing things like creating graphs is quite different, but it's all possible.
Also note that depending on what your app is doing, PhoneGap is one of several solutions. If you want a "native" look/feel, consider TitaniumUI -- it takes common code (still JS) and pushes it through some translation layers to create native UI components.

Categories