What is the Microsoft version of an embedded Java web applet? Is there a good example of one on the web?
Also, why is the dynamic web dominated by ajax and not embedded applications?
Silverlight is probably the closest thing now.
As far as why the web is dominated by JS driven websites rather than embedded proprietary applications I'd venture to guess it's the openness of the resulting web pages. Almost every web browser out today ships with a JS engine, and most users run JS; this is important because it means the user doesn't have to have any other applications (beyond the browser) installed on their computer.
JavaScript driven sites are also more portable than embedded applications -- the developer only needs to worry about a browser being installed (though perhaps a particular browser), not what operating system the end user is running. In terms of being on the web, only having to worry about browsers is better than having to worry about browsers and operating systems.
Furthermore, the pages that result from JS execution are selectable, the text can be copied and pasted -- in general, JS-driven websites are often more accessible (though often not as accessible as plain-old-text websites).
Perhaps something that helped JS/Ajax rise to the top was that it could so easily access to the DOM, so it plays nice with HTML (and the existing web infrastructure).
An ActiveX control?
Also, to your second question, well these "embedded applications" as you call them aren't really web applications. They are components that require browsers to support some sort of way of hosting them that are outside of the realm of traditional Web standards and specifications. As for why these applications don't "dominate" the markert, they tend to break out of the way the web works and many kinds of platforms and devices don't support them such as mobile phones.
The Microsoft equivalent of an "applet" is roughly an activeX control, although they are only vaugely similar - the similarity is that they are both embeddable into the browser. The most notable difference other than windows vs cross platform is in the region of security. With ActiveX, it is all or nothing - you either don't run it, or you trust it with everything - the activeX control runs as a regular windows "program" and has the same level of access as other programs running under your account. With an applet, security is more finely controlled, with the default being a controlled environment - the "sandbox".
As to why AJAX is more popular might be considered a subjective question, but from the technical perspective, some objective points in favor are:
it is implemented on top of a browser model that aims to provide a safe/secure execution environment
is cross platform (in as much as the browsers adhering to the various standards involved.)
has a suite of development tools and libraries for getting results quick
it can manipulate the components in the browser rather than working inside an isolated embedded box
it provides a better end user experience - seamless integration with the webpage with no security warnings, certificates, popups etc.
You could consider ActiveX or Silverlight both as alternatives to Java Applets.
Ajax is built on open standards, is natively supported by most modern browsers without requiring a plugin download, and when done correctly is often the best option from a performance standpoint.
Related
Are there any alternatives to Java Applets (or Web starts) and Flash (or Silverlight) for a browser application that allows file access / hardware access to client machine?
Java and Flash/Silverlight both have deficiencies that makes them unfeasible solutions for my projects.
Are there any new technologies for this purpose, that are not yet popular but might be so in the near future?
No there's no technology right now or even in the future that would be allowed to do that from a web browser. Such a technology would allow all hackers to take control of all personal computers without passing any check.
If I am getting it right from what I am reading, JavaFX 2.0 allows you to code all your logic using Java and design screens with FXML. Then, web apps run as an applet on the client side.
But:
Are all browsers and mobiles devices capable of running applets?
Is it efficient (i.e., nice user experience)?
In other words, how portable are JavaFx 2.0 web applications on the client side? Anyone has experience to share?
From How to run Applets on Android?, it seems like android is not capable of running applets.
So, it seems like JavaFX 2.0 is ok on most browsers, but not for portable devices such as smartphones.
JavaFX produces Java applets. So what I say here applies for Java applets.
Most browsers for desktop machines are Java compatible: IE, Firefox, Chrome, Safari, Opera on Windows, Mac, Linux and Solaris. For smartphones, it seems a lot more complicated. I think it must be a definitive no for iOS, Blackberry and Android. For Windows Phone, it might be possible, but probably too complicated for the mainstream user.
Efficient is a broad idea. It has advantages (performance once started, openess to the rich Java ecosystem) and drawbacks (time to startup, size, all applets running in the same JVM instance). Java 7 improves the experience, as you can read here: http://www.oracle.com/technetwork/articles/java/javaclient-484666.html
JavaFX applications can be packaged in a numerous amount of ways. They can run as applets in a web page, they can be launched through java web start, they can even be distributed as os native applications. So yes, JavaFX is as portable as portable can be. Other people in this thread has already talked about JavaFX applets, which is what governs your question. So I shall not elaborate on that. However, I feel you might have missed the fact that JavaFX clients must not only be distributed as an applet in a browser in order to talk to the back end. Indeed I would not even consider that as an alternative, judging by my own past experience of applets and how ugly they look in the context of a web page.
As an alternative to applets, you can write a JavaFX stand alone application who talks to the back end using a SOAP- or REST based web service. Internet is full of these examples. Moreover, you can have the application be launched through Java Web Start and do dependency injection to get hold of proxy objects to resources on the server. This last part is not talked about by blog posters and Oracle articles. Indeed I haven't found a standardized way of doing that. But if you package a regular Java SE application in a EAR package you can inject resources in this application's Main class and let the thread startup a new JavaFX application and forward those resources. Here is a tutorial I wrote that takes you through the entire process:
http://blog.martinandersson.com/the-enterprise-side-of-javafx-the-missing-part/
I am a fresher in web developing , is I ve to study applets?
If you are a Java person, maybe look at JavaFX instead (even though it is not clear yet if that technology will take off any more than applets did).
If you are a web design person, do not even think about it before you got acquainted with Flash and HTML5. Applets are quite marginal at this point.
Most folks say no, but I still see a lot of great uses for Applets and in fact have seen really complex commercial UIs coded within the context of an applet.
in a short word, no, applets are a dead technology for the general purpose web.
on intranets with lots of bandwith and controlled client environments they maybe of some valid use.
look at Google Web Toolkit (GWT) as an alternative to creating applets.
Adobe Flex is also a good alternative now.
If you want an embedded client application, the Java Web Start (the better Google keyword is JNLP) is less or more the successor of the legacy Java Applet. Alternatives to this are Adobe Flash and MS ClickOnce.
If you want an RIA (Rich Internet Application), then JavaFX is the better Java based choice. Alternatives to this are the MS SilverLight, Adobe Air and Adobe Flex.
Apart from JavaFX, Flash, you can learn about Adobe AIR and Microsoft Silverlight. They are kind of extending the limits of what was earlier possible with just Flash
There is still one thing that I know of that a Java applet can do and Silverlight, Flex (non-AIR), etc can't do:
Drag and drop from the filesystem.
Flex offers a o/s based browse and select filesystem access. Silverlight has a similar functionality. But to the best of my knowledge if you want the user to drag a file from Windows Explorer etc. into a web-site based control, Java applets are pretty much your only choice. You could create a Flex based app using Adobe AIR that can ask the filesystem outside the o/s browse and select dialog but I'm not convinced the AIR install base is adequate yet. Probably depends on your target customer (early adopter, install whatever you say to vs. stable corporate user with IT lockdown on their workstation).
If someone knows otherwise for certain, please comment!
But to answer the original question, unless you need the drag and drop filesystem to web functionality, I would spend your time on Flex. Silverlight and Java FX can't compete with Flash for market penetration. Since Flex compiles to flash, it has a very high install base (>95% of internet enabled computers) and its base updates to the newest version frequently. Inserting a flash file into a browser is a easier than the arcane art of applets.
if you want/might get a job where you maintain old applications then probably you will deal with Applets.
For new projects, dont get close to it.
There are many RIA frameworks popping up (flex, extjs, gwt to name very few).
If my server is written in Java, why not use java web start?
The benefits I see: I get to program in a language that is easy to debug (compared to javascript), I can use the same code in server and client side (validations, model objects). With SWT I get nice looking GUI.
Even if it means requiring a plugin in the browser (or using a cli tool), if my application is an enterprise application, does it matter?
For webstart you need Java installed on the client. For Flex Flash. For Silverlight .Net. For other RIA platforms a JavaScript enabled browser. It is a lot of product politic in that question.
And Java is very intenting, because "all seems to be a nail". Of course one of the great advantages of Java: same language, same knowledge, same code on every platform or environment (server/client/middleware).
For enterprise internal use, no it does'nt matter at all. If your biz is on the internet the decison is much more complicated (or even you have to offer the same functionality in diferent platforms).
The only contra argument is that in a lot of cases it's impossible to force the clients of your rich client app to have Java runtime installed on their machines. Everything else is a matter of taste, already existing knowledge and experience.
I think that until now the perfect client technology simply does not exist. We were excited about ajax and then there is another "hot" technology like Adobe Air. What is the difference between these techs and the "old-fashion" client-server apps? My friends we are back to the early 90s!
The AIR for example needs a runtime installed on the client machine, it has access to local system resources and communicates with the server using a binary protocol. On the other hand we are developing "RIA" applications (and very good ones :) using pure java swing clients communicating with the server through the Spring's binary remoting protocol. And i must say, in such a development life-cycle Java-Webstart is the winner. Especially in large-scale projects (and i mean laaaarge-scale, not just e-shops) in the java field i haven't found something more productive and maintainable (ah! maintainence... another big story) than this.
IMO if your users can live with a nice look-and-feel and you don't have to adopt another technology just because it is young and sexy use webstart. Put more work in your business model. After all enterprise apps is about business, not animations. And money is where the business is ;)
Yes I think it does matter, seeing that some big companies still have IE6 as their standard browser and as a requirement for web based applications. And those won't allow you to install any third party plugins into their dinosaur browser.
And you don't make a difference between RIA technologies that use existing browser technologies like JavaScript, CSS and HTML (including GWT which just generates client side JavaScript and ExtJS which is just a JavaScript Component library) and the ones that require an additional runtime environment (Flash, Flex or client side ).
Of course some things are easier to accomplish with proprietary or third party solutions (or you just have more knowledge in one of these platforms), but I still think that there is a huge potential in technologies that are standardized and already implemented in every modern browser (the differences between the browsers are slowly but steadily getting better, too).
If you ship it as a 3rd party application you can define a JRE as a System requirement, anyway but then instead of JavaWeb Start ship it as a normal Java Application as well.
Has anyone had experience taking a full-fledged Java desktop application and replicating the functionality using Flex?
If you have, what are some of the biggest things to watch out for or pay attention to?
What are some recommendations you can make based on your experience?
There could be any number of issues to watch out for. Here's a few that just come to the top of my head:
Flash Player restrictions that do not exist in the JVM, such as the ability to reach "outside" of the Player's bounds rectangle (and myriad others).
ActionScript 3 has no equivalent of java.lang.reflect.Proxy, unfortunately. This means that (so far) there are no decent mock object frameworks, and limitations with respect to reflection in general.
I am not aware of any AOP capabilities on the order of what you will find in Java.
Whether or not the Java application is using libraries that have no equivalent in Flex and which you do not wish to write yourself.
Java applications can call out to native code with the JNI, whereas this is not yet possible with the Flash Player.
Even if by "Flex" you include the Adobe AIR platform, the environment tends to be much more restricted in general than the JVM. However, don't let that discourage you - you get a lot of benefits from using Flex, such as an ubiquitous runtime, a great language and component development framework, etc. If your Java desktop application is an RIA, then Flex is probably a good candidate for a port.
I'm not sure if replacing a full-fledged Java desktop application with Flex is the best alternative. From Adobe Flex page: Flex is a highly productive, free open source framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops, and operating systems.
Adobe AIR is probably a better replacement for desktop applications, if you're considering Adobe realms of products.