Applets reloaded
Applets reloaded
foreword
It's no secret that Adobe Flash fully took its position on the Internet. According to general statistics, almost 98% of Internet users have the Flash plugin installed. The main purpose of which is the implementation of “rich UI” (eng: rich user interface), in other words, a beautiful, dynamic interface. Recently, however, two giants have decided to shake his position - Microsoft and Sun. Microsoft released Silverligth technology, and Sun decided to deliver a more serious blow. By releasing several products at once with a common and fairly clear goal - to shake Flash / Flex.
applets
This in itself is not a new word. And if more precisely then pretty old. In fact, the possibility of developing “applets” appeared back in 1995. After 13 years, the technology has not actually become widespread. In fact, this is not surprising. Persistent security issues, persistent browser compatibility issues, applet rendering issues that cause the browser to freeze. The list of shortcomings can be continued for a rather long time, and what’s most interesting is that it’s hard to find those who will contradict this. Ken Russel (architect of the new plugin) on August 28, 2008, giving a presentation to Google employees, made it clear that all these problems had long been known at Sun. But most of the time he took away the main question - “how to fix everything?”. Let's see what answer they found on it.
According to Sun, almost all of the plugin code has been completely rewritten. In fact, it’s not just rewritten, but the plugin architecture itself is completely redesigned. Now the plugin is almost completely implemented in Java. The only platform-specific part is the Java <-> JavaScript bridge. According to the assurances of the company, they were able to develop an interface that requires a minimum number of browser-dependent methods for the full implementation of this bridge. This allowed them to solve the problems that existed previously regarding the stability of Java-JavaScript communication, which only acceptable worked in Firefox Mozilla. The plugin internals underwent a really big change. Now, the JVM that runs the applet is completely separate from the browser process and connected to it through a small asynchronous client that is in the browser process. This is to ensure that the applet does not freeze and the browser does not freeze. In addition, new features have appeared that, on the one hand, greatly untie the hands of developers, and on the other, add questions. For example, applets on the same page can (but are not required to) execute in different JVMs, the developer can now pass command line parameters for the JVM for each applet. Additionally, each applet can execute a specific version of the JRE.
For example, an interesting consequence of passing parameters to the JVM is the ability to increase the size of virtual memory available to the applet. Sounds good, isn't it? However, the author begs the question - now when you open the web page, we should be prepared for the fact that it will take 2-3 GB of RAM just because the developer decided to play it safe and allocated 512 Mb on each applet which is 6-7 here?
However, this fact solves the most global problem inherent in the applet - the browser freezes at the time of loading and starting the applet. According to the promise of the developers, this is now a story. Due to the fact that the applet is in a separate process, the browser behaves normally all the time necessary to launch the applet, and as soon as the applet starts it is actually inserted into the web page. Here are just experiments show that in realities this is not entirely true ...
Jnlp
Now the plugin fully supports the new way of placing the applet on the page. The plugin fully supports JNLP which is used in Java WebStart. In fact, it is this fact that is most significant in the entire update. This actually frees up the hands of programmers. Firstly, an applet is no longer just an applet; in fact, this means that the same component can be either an applet or just an application installed via WebStart. But even this is not the most important innovation. And the most significant is that now you can use third-party libraries and load them for an applet. For example, you can connect JOGl. That is, in the applet, you can fully use the hardware accelerated OpenGL. But hardware acceleration can be used not only for 3D but you can also control hardware acceleration in 2D graphics. Undoubtedly the availability of 3D graphics on a web page is an interesting perspective. This will be especially interesting for on-line games. For example, enthusiasts ported the famous Quke 2 game to Java and with the new plugin it can be launched directly from the browser, the project is now called Jake 2 (http://download.java.net/javadesktop/plugin2/jake2/). Another interesting development is the applet developed by NASA - it is actually an analogue of Google Earth, which can be freely used to display a three-dimensional map of the planet on a web page. (http://download.java.net/javadesktop/plugin2/wwj/). net / javadesktop / plugin2 / jake2 /). Another interesting development is the applet developed by NASA - it is actually an analogue of Google Earth, which can be freely used to display a three-dimensional map of the planet on a web page. (http://download.java.net/javadesktop/plugin2/wwj/). net / javadesktop / plugin2 / jake2 /). Another interesting development is the applet developed by NASA - it is actually an analogue of Google Earth, which can be freely used to display a three-dimensional map of the planet on a web page. (http://download.java.net/javadesktop/plugin2/wwj/).
The backward compatible model of embedding an applet on a page is also interesting. In fact, you can embed the applet in such a way that it will be recognized by both the old and the new plugin, moreover, you can run one applet if the old plugin is installed, and another applet if the new one is installed. This is all accessible by standard means without the need to dynamically change the applet's embed code.
The interesting thing is that now virtually every applet can simply be "pulled" out of the browser with the mouse and it really installs and starts via Java WebStart. Moreover, this will happen even without restarting the applet. This is a rather interesting fact and undoubtedly quite convenient in theory. But most of all, it’s interesting how our “friends” use dishonest advertisers who use the slightest opportunity to open pop-ups. For some reason, the author has no doubt that they will come up with a way to make the user “pull out” the applet from the browser and fully deploy to the user's computer. An important fact is that the applet pulled out of the browser is already actually “trusted”, and all user data under which the JVM is running is available to it. The fact that the applet can create its own windows already seems rather dangerous. Of course, the developers thought about it and all the windows created by the applet are marked with an asterisk and an additional “close” button. How this really effectively alerts a simple user about the danger is a moot point.
Another interesting fact is the new data warehouse available for applets. This store has a very limited amount. But this opens up interesting prospects for the "labeling" of the user computer. Yes, this functionality is also present in Flash, but nevertheless, the applet is able to save data without any user notifications. And if quite a lot of users know how to delete data stored in the browser, then how many know how to delete the Java plug-in cache?
Java fx
The new plug-in fully supports JavaFX. This is a new scripting language developed by Sun to create a rich dynamic interface. This is actually a direct response to Flash. The language is really quite simple and functional at the same time. Applets created using JavaFX really initially seem to be just Flash, and only with a detailed look you can notice that this is not so. Quite interesting is that, according to Sun, JavaFX outperforms its competitors in speed.
Very pleased that JavaFX is a declarative language. Given the success of other declarative languages (HTML, XHTML, XML), success can be assumed for him. Moreover, the technology makes it possible to very well separate the work of a programmer and a designer, which in itself always presents the main problem in the development of web applications. An additional plus is portability to different platforms, and here we are not talking about software platforms, namely hardware ones. At the moment, this includes mobile devices and TVs (virtually all devices for which Java ME is available). However, there is the main difference between Sun and Adobe solutions, JavaFX is focused not just on a beautiful interface, but on interfaces with a lot of animation. And this phrase carries a very deep meaning. In fact, the rendering core is optimized specifically for animation,
Conclusion
Sun pretty seriously worked on new technologies, and their interconnection. The technologies are really thought out and therefore convenient to use. The main problem for them, however, will not be their own shortcomings, but rather how developers relate to applets. That is why the word "applet" Sun is trying not to use anywhere. Which, according to the author, is really justified, since in fact there is nothing to do with previous implementations. Now the business is left entirely to the industry, which either decides to abandon prejudices and then the future is guaranteed for all these technologies, or the headings will disappear with time and everything will remain as it is.