I'm working in a webapp with Spring and I always used JSP and Jquery, In a recent conversation, some guy commented: You should use Flex instead.
Would Flex be a good choice for a web app? What are the advantages of using it vs. just JSP and Jquery?
I think you really mean to ask; why should I use Flex instead of JQuery.
JSP is a server side language. Flex or JQuery are client side languages. Flex is not a replacement for JSP any more than JQuery is a replacement for JSP.
Flex can be used to create a Flash Application; which can be deployed in a few different ways.
It can be used to create a browser based application that run in Adobe Flash Player. The Flash Player is only supported on desktop browsers, and there are no viable options to deploy a Flash Platform app to current mobile browsers. I would only recommend this if you had tight control over the machines accessing your application.
It can be used with Adobe AIR to create a desktop application for Windows or Mac machines. I, personally, think the use case for this is even smaller than creating browser based applications.
It can be used with Adobe AIR to create a Native Application on iOS, Android, and Blackberry Playbook. If you are tasked with building a Native Application that needs to be deployed on multiple mobile OSes; I think that Adobe AIR presents an intriguing option.
if you need to build Native mobile applications, and you already know JQuery, I'd recommend investigating options to build your JQuery apps as Native Applications. I know options are out there to convert HTML into Native Applications, but can't comment on them. I see no need to switch your technology unless you are running into limitations. To evaluate Flex ;you'd have to define what those limitations are and then decide whether Flex will help solve them. Usually the time savings of "use what you know" outweigh any benefit that comes from switching technologies.
That said; Flex provides some things that I don't see yet in the "HTML5/JavaScript" space. It has a robust UI Framework that works identically across all the platform targets, a step through debugger, and a memory profiler just to name a few.
The two technologies are completely different. JSP/jQuery would give you a web application. Flex would give you a Flash application.
Personally, if JSP/jQuery would work for you then you should go that route. If you don't need the features of Flex, there's no reason to require the user install the plugin.
Related
I am starting a new app that will target both web and mobile (but possibly only as HTML5, not necessarily a native app)... So, what are the frameworks you guys recommend? I am familiar with plain ol' ASP.NET, and some minimum AJAX. So is it best, for example, to build a ASP.NET REST based API with a JQuery and JQueryMobile?
I'm looking at a similar approach while we're commercializing an app of ours.
Considerations
After 5 months of research and experience combined with the comments above, here are some considerations:
Do you have control over your users' browser selection? If yes, HTML5 is a great and flexible. If your users are more up-to-date I would also recommend HTML5.
The server-side framework in most cases will not matter, as long as you can develop a robust server with an efficient data model that's familiar and manageable.
Are your mobile devices tablets or phones or both? If you are using phones it will be harder to fit and prioritize the interface.
Do you know all of your app's functionality? This will be important for determining UX which will then help you understand how you will build out the client.
Is your app real-time? And you have modern users? Websockets are handy. Here's a demo for ASP.NET http://wsaspnet.codeplex.com/
Recommended Frameworks
Given your case, here are some recommended frameworks to make life easier:
Stick with .NET on the server-side since you are familiar with it
Use backbone.js to manage your client-side template
HTML5 boilerplate is also worth a look http://html5boilerplate.com/mobile
Use the latest JQuery library
Use JQuery Mobile to adapt your HTML5 app to mobile devices
There's also JQTouch http://www.jqtouch.com/
Custom build your "fluid" javascript to adjust your client to different interfaces (I haven't been satisfied with current plugins and frameworks)
If you are using websockets, web-socket-js is very handy for a flash fallback https://github.com/gimite/web-socket-js ...otherwise stick with AJAX REST
Consider PhoneGap to adapt your app if you need to distribute the app in approved marketplaces outside the browser http://phonegap.com/ and https://build.phonegap.com/
Here's a C# Websocket server: http://www.codeproject.com/KB/webservices/c_sharp_web_socket_server.aspx
Remember
Sometimes it is just necessary to build a separate client for mobile if your app is complex. It can be native, HTML5, or HTML5 put through PhoneGap.
How to create web application using Qt?
This depends on what you mean by "web application". If you mean an application that can show parts of a web page in its interface as rendered HTML, like a browser can...yes. Qt incorporates something called QtWebKit:
http://doc.qt.io/qt-5/qtwebkit-index.html
(Note: Back in the olden days it was Microsoft--I think--who first made an embeddable Internet Explorer control so that you could fetch a URL into the midst of some MFC or VB application and run a browser in the midst of your otherwise-form-based application. The event hooks for Microsoft's solution sucked, Qt's are much better.)
Anyway, this is great if you want people to install your application on their machine, where it fetches web data but takes advantages of native features to be richer than a browser could. But be careful because these days native apps have to be really outstanding to surpass the advantage of something that runs in a browser they already have.
HOWEVER If you are trying to use QtCore to push server-side content out and fulfill web requests, that'll be an uphill battle. You might find some related examples if you look hard enough:
https://web.archive.org/web/20100922075100/http://labs.qt.nokia.com/2006/12/20/whats-this-cgi/
Very few people use C++ (much less Qt) to generate web pages server-side. Yet there are still some doing it, even in pretty cool ways:
http://www.webtoolkit.eu/wt
...regardless, QtCreator will be no help in that kind of pursuit.
The functionality you are asking for does not exist within Qt itself. However, there exists (at least) one third party library that allows some of the Qt code for a desktop app to be re-used to a certain extent for serving up a web app:
http://cutelyst.org/
However, this does not magically allow you to write a QML interface with QML Widgets and have a visual interface accessible via a web browser.
What do you mean by "web application"? Is it a desktop app with web features? If so, yes Qt in general is very good for that.
If you mean a kind of server that outputs HTML, then you should use something else because you would have to reinvent many wheels to make it work.
You'd require to run or embed web server. It would be more whise to turn to a Apache Web Server or Apache Tomcat based approach. Otherwhise you'd run somewhat against the odds.
Consider also using some HTTP server library like libonion or Wt. Wt is close in spirit to Qt. However, you won't use Qt itself. libonion is lower level (and you may want to use browser-side Web frameworks like e.g. JQuery or AngularJS with it).
If you already have some Web server, you could consider developing some FastCGI application in C++.
You surely need a good understanding of HTTP protocol and of HTML5 & AJAX.
Since this is 11 years old, I thought I'd come here to tell you that it does indeed seem possible now that qt supports webassembly. The newest version, 6.4 (newest version as of today jan 31 2023), now offers support for webassembly and their website has various examples of apps built with qt that run in the browser.
https://www.qt.io/qt-examples-for-webassembly
Over the past 6 months I've been developing web sites using asp.net. When I design something such as a contact form, 99% of the time I find myself using a script manager and update panels. Recently I tried out silverlight and expression blend, and I love it.
Is there any big cons for me to start building my forms with silverlight instead? The only big one I can think of is the user might not have silverlight and not want to download the plugin.
I guess to solve the has and has not issue, I could make a silverlight version and a standard version until it comes to the point where the plugin is as popular as flash.
Personally i would advocate doing everything in SL because i love what you can do with it. But common sense dictates otherwise. There is no point replacing relatively static webpages with a SL app. While there are methods to communicate/cooperate between SL apps and the web pages that host them, you don't really want to do this unless you have to, you can end up with quite a kludgy solution.
SL is not suitable for everything. The times you want to use it are when you can redo (or create) a whole web app (or significant chunks of it), and you want to create a more immersive and interactive desktop-like experience for the user. You also need to read up on authentication with SL and WCF services, SL navigation, and become familiar with the SL4 Out of Browser feature as it offers you some features/benefits beyond what is available to an in-broswer SL app.
The Silverlight plugin is not available in mobile devices. Also, SL 3/4 is not yet 100% supported in Linux.
You really have to take in consideration your targeted audience.
If your app is meant to be used anywhere SL or event Flash is not a good choice. None of them run on iPhones for instance.
The Silverlight platform is a good compromise between the richness of a fat client and the easy of deployment of a web app. Intranet environmentss are great candidates to take advantage of that.
The platform runs well in both Windows and Macs, and should get better in Linux too.
I have some basic experience in making Flex sites, but I think I have more use for Flex in making a desktop AIR application.
Anyway, I was wondering if it is at least possible to use C# alongside Actionscript/AIR? I can't find any example of this.
Also, can I use custom Flash components in a Flex app? I know I can use Javascript components.
Thanks
Your options with AIR are limited to HTML/JS, Flash/ActionScript or Flex. There's no support for other languages and frameworks.
You can create a C# console application and call this application from AIR.
var file:File = File.applicationDirectory;
file = file.resolvePath("CSharpConsoleApplication.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
nativeProcessStartupInfo.arguments.push("-arg");
var process:NativeProcess = new NativeProcess();
process.addEventListener(NativeProcessExitEvent.EXIT,onProcessDone);
process.start(nativeProcessStartupInfo);
In this way we have a C# application with AIR interface.
Slukse is correct -- it depends on what you mean by "alongside."
Obviously you can't compile C# code into a SWF -- that much we know. But you can certainly embed (as davr suggests) an ActiveX control into a .NET Forms app, load the SWF into that control, and use the ExternalInterface API to bridge the C# code running in the desktop app and the ActionScript code running in the SWF. If by alongside you mean writing server-side C# code to render data consumable by the Flex app, then of course, you can do that, too -- there's plenty of documentation out there covering how to connect a Flash or Flex (or AIR, by extension) app to Web Services of a variety of flavors, including the relatively new-ish WCF stuff.
Another way to go would be to run a standalone C# desktop app (e.g., a service, console app or the like) and have that app listening over a certain local port -- then have your SWF talk to that app using the Socket classes. I'm doing something like this now (with Java, not C#, but the idea's the same) for a personal project.
If by 'alongside' you mean using c# as middleware to connect to your database (probably SQL Server), or to perform remote calculations then yes you can. You can connect to a c# service using remote objects. The midnight coders produce a product called WebORB that is fairly simple to use. Version 3.4 was a totally free version that should suffice if you are building desktop applications in Air. The next two versions are not free but basically offer no real advantage to you.
The only way I know of doing this is with C# web service programs and the AIR/Flex apps communicate with the web services.
The whole point of AIR is to enable web developers who know AS/JS to be able to easily make desktop applications which are automatically portable to win, linux, and mac. Hence why there is no way to connect it to other languages like C#, C++, etc, since web developers generally don't care about those languages, and if they were used, the app is no longer portable (yes, most languages can be ported to other OS's with some effort, but the point of AIR is that you write whatever you want, and it runs everywhere with no extra work).
If you want to combine C# and Flash, instead of trying to put C# inside AIR, what you should be doing is putting Flash inside a C# app. There are various resources for this on the internets, here is one I found in a quick search: Example: Using the External API with an ActiveX container. When you are searching, make sure it talks about the newer, more advanced ExternalInterface / External API method, and not the oldschool SetVariable/CallFunction/watch method. The newer one is much easier to use & has more features.
Also, yes, you can use custom Flash components inside a Flex app. Generally you just make a SWC inside Flash CS3 (or CS4), and then import that SWC inside Flex Builder (or Flex SDK, or FlashDevelop, or ...)
If you are making the components yourself inside Flash CS3, you should use the Flex Component Kit. It provides some features for you, and puts in the boilerplate code, to make your flash component play nice inside Flex. It's included with Flex Builder/Flex SDK.
I came across the Adobe Flex framework one day. After watching http://www.adobe.com/products/flex/media/flexapp/'> the demo of Flex, it looks to me it is a bundle of different Ajax controls. I have no working knowledge of Flex at all and know very little about Flex. Therefore, I would like to hear from the developers here with some Flex experience to explain a bit more pros and cons of this Framework. In particular:
How productive it is to program in Flex compared to the .Net + Silverlight?
Any technical advantages over other frameworks?
Any disadvantages ?
Does it have any known scaling issues?
What kind of web servers can it be hosted on?
Any other things I should be aware of about Flex?
How productive it is to program in Flex compared to the .Net + Silverlight?
Way more productive than Silverlight as it has a much richer and capable control library. Silverlight is rapidly gaining ground here though. I think by the time SL 4 comes out they will reach feature parity, maybe even SL 3.
Any technical advantages over other frameworks?
If you can create it in Photoshop, you can pretty much do it in Flex with the help of the Flash drawing API. If you want to build very interesting data visualizations (tree/node diagrams, such as an org chart) you can do this Flex without a ton of work.
Any disadvantages ?
There is no server-side component to ActionScript so you need to find a way to pass data between Flex and your backend, be it Java, .NET, PHP, etc. There are libraries out there to AMF remoting with just about any backend which makes it easy. But as far as the objects you pass between the two, you need to maintain both or use a code generation tool to create AS3 classes from your backend classes.
Does it have any known scaling issues?
Flex is simply a presentation technology so this question doesn't really apply.
What kind of web servers can it be hosted on?
Again, only a presentation technology. It compiles out to a SWF file that is loaded by the browser over HTTP and then executes inside of the Flash Player plugin.
Well ~~ .. it's more that Silverlight is similar to Flex. It's not Ajax so much as a kind of 'walled-garden' inside of which you have a rich programming environment. Somewhat like Java apps say.
The usual criticism derives from just that. Flex/Flash applications tend to be ignorant of the browser (more or less) so that stuff like back-button usually gives unexpected results.
It'll run on all the current browsers on all platforms. You don't need to "host" flex as you build a SWF file that gets loaded into the browser and is executed by the Flash Player which your users are expected to have already downloaded/installed .. (95+%) penetration helps.
I've been using Flex for the last year or so and it's served my purposes well. It can be integrated nicely with javascript stuff on your web pages and provides a very rich set of capabilities for doing all sorta things like web-services and XML processing and of course all your video/audio/music rich media.
The language is ActionScript 3. Which is fundamentally a strict superset of javascript. You can use javascript as-is. (ActionScript was intended - by Adobe - to be next-gen javascript.)
It can compiled in two modes. One is for hosting in a browser as web app, using the Flash runtime object to provide granular GUI controls.
Or it can be compiled in desktop mode, where it uses another runtime (named AIR) to operate interchangeably on Windows, Mac, or Linux.
I wouldn't compare it to Ajax. It's more like .NET, if .NET didn't have such a disparity between desktop.NET and ASP.NET. Pretend ASP.NET offered a desktop runtime, maybe. (Not a bad idea, actually).
Like a lot of non-MS technology, it tends to be basic yet cover the important capabilities. More conceptual integrity, IMHO. About the same scale, scope, and complexity as VB6 and useful for about the same set of tasks, for about the same audience of developers and users. Yes, it's got good database connectivity too.