神刀安全网

JavaFX: Call to ARMs

(Pun intended)

Background

Ah, the enigma that is JavaFX .

So much promise, so many features, so many positive attributes and yet (apparently) so little success. And, such ambivalence, apathy and lack of support by its creators. Is there a greater software conundrum in the world today?

So, “what gives”? And more importantly, what needs to be done to solve this easy-to-define yet difficult-to-fix problem?

The initial release of something referred to as “JavaFX” was way back in 2008, although it bares little resemblance to the product of the same name that exists today. The first “authentic” JavaFX version was not until the second major release in 2011 but JavaFX seems to be one of the slowest evolving products in the history of software development, which correlates directly with its very slow uptake rate with the intention of eventually completely replacing the incumbent standard Java GUI toolkit, Swing .

Even right at this moment, there is no official release of JavaFX for any mobile or embedded platform and is only officially supported (by Oracle) on the 3 major desktop operating systems. In a world rapidly shifting away from large, clunky machines on everyone’s actual desktop to a world of mobile phones, tablets, embedded devices, the whole Internet Of Things (IoT) phenomenon and even wearable technologies, how could a veritable dinosaur like JavaFX possibly be a viable toolkit for modern software development where the desktop is very quickly becoming the least utilised and important hardware platform?

On the surface, it would be obvious to leap straight to the conclusion that JavaFX is already dead as a door-nail (or extinct ) and that it should not even be laid down on the table of potential frameworks to consider using to develop your next application.

But, I for one personally believe that not only is JavaFX worthy of being on that table but also that it has the potential (given the correct alignment of the planets) to be the best of those options on said table in almost every case!

Have I totally lost my mind?  How could this possibly be even remotely possible?

Well, let’s take a closer, more thorough look at JavaFX and then you can decide for yourself…

The Slight Rise and Near Demise of JavaFX

So, for reasons not necessary to detail precisely here, not many people really took any serious notice of JavaFX until version 2.0.  The major reason was that it was then possible to write your JavaFX code in the world’s long-standing, most popular programming language Java , rather than some esoteric, totally new and unfamiliar language ( JavaFX Script ).

And, it comes as no surprise that this is when a huge spike in both interest and actual adoption occurred.  JavaFX was on the rise and showed much promise with it’s potential to write applications for all major platforms of that time with modern features like video, audio, animations, embedded HTML5 browser and, of course, hardware acceleration and, most significantly, a common code base written in Java.

Then, came integration of JavaFX into the standard Java run-time platform and JDK and lots of shiny new features in the version labelled JavaFX 8 to be in alignment with the same version number of the Java language itself. This is when we started to see a growing and, soon after, thriving JavaFX community and lots of tangible and often spectacular examples of real world applications appearing all over the place.

JavaFX had not only arrived but had now risen to the dizzy heights where a large number of companies world-wide started to seriously consider JavaFX as a very worthy candidate to use for both in-house and commercial applications and actually select it over its competitors with the simultaneous emergence of a vast array of third-party and largely open source frameworks, tools and applications and highly talented and enthusiastic individuals willing to freely champion the JavaFX cause and produce outstanding code samples etc.

Unfortunately, somewhat earlier than this, a massive paradigm shift had already commenced, namely the aforementioned shift towards mobile and smaller, lower-powered hardware devices, most notably Apple’s iPhone and iPad and an plethora of similar Android-based devices.

With JavaFX not being capable of running on any of these devices (which, as stated were now becoming the main focus of both software companies and business/home users as well), it suddenly appeared to be facing an imminent and sudden death-by-irrelevance .

The Further Decline of JavaFX & The Low Point

Tragically, this paradigm shift was not the only factor that was apparently about to bring on the total annihilation of JavaFX. Now, it had the almost impossibly heavy burden of gaining a reputation and massive spread of FUD that the very creators of JavaFX (Oracle themselves) were going to completely walk away from their progeny and leave it technically orphaned.

And these suspicions were based on some very real and valid red flags, most notably the abandonment of an official release for ARM devices, the cessation of releases of the GUI design tool for JavaFX named Scene Builder, the confirmation by Oracle that there were no plans to officially support mobile platforms, the “letting go” of several Java evangelists from Oracle (many of whom were amongst the JavaFX elite) and the apparent apathy and tight-lipped or vague statements from Oracle regarding their future plans for JavaFX (if any).

We were now at the Low Point of JavaFX . (Help me Obi-Wan, you’re my only hope!)

JavaFX is Dead. Long Live JavaFX!

Being at the Low Point is obviously the least likely place the highly enthusiastic JavaFX community wanted JavaFX to be. But being at the bottom does have it advantages: it means that you know things can’t get any worse, and, if something did change, the only direction for JavaFX from then on was UP!

And, just as the Phoenix rises from the ashes, their was something of a “divinish” intervention and suddenly the community morale lifted and JavaFX was suddenly on the rise once more!

The “intervention” I refer to was the sudden emergence of the company named Gluon , guided by the highly experienced and talented hands of Java Champion Johan Vos .

Now, while Johan and I are probably unlikely to be sharing a beer any time soon, I have to hand it to the guy – he gets things done and done FAST . Johan was already a “legend” amongst the broader Java community (that group of 9-10 million people) having been the main person responsible for getting the Java language itself to run on Linux platforms for the first time. Let me tell you, this would have been no mean feat! It is testimony to the undoubted extremely high level skills of the man.

And thus a saviour for JavaFX was born. But not on Christmas Day (presumably!).

So why do I use the word “saviour” here? Well, mainly because it’s highly appropriate.  Gluon took over further development of Scene Builder and quickly released an updated and much improved version, but most significantly, finally there was a commercial entity that was passionately dedicated to getting JavaFX to run on “modern” platforms such as iOS and Android. Throw in RoboVM who successfully AOT compiled Java byte codes to native Objective-C to facilitate Java running on iOS and others who contributed to the Android port, and we were now ready to take on the world!

Sure, this fulfilment of the full WORA principle is not quite there yet, but it is not that far away…

Where To From Here?

Where JavaFX and its community goes to from here on depends mostly on where they actually want to go.

I have the feeling that just being able to produce what are basically Swing-like forms based apps with a few nice modern features added on and to have a single code base that can spawn binaries for all the new and traditional platforms would be “enough” for many members of the community.

But not for me.  We must aim higher. Much, much higher.

My own personal goal for JavaFX is to facilitate it maturing and evolving into THE premiere toolkit for cross-platform graphical apps of ANY kind.

Sure, we are quite a long way from that situation right now, but I see absolutely NO reason why (again, with the planets all aligning themselves) that the combined efforts of the growing and highly motivated JavaFX community cannot make this outcome a reality.

Winning: How Do We Do It?

Well, achieving my own personal “winning” goal (which I believe should be the goal of the entire JavaFX community) has to start with a truly authentic and firm belief that this goal is reachable, and not in 10 years but within no more than 18 months to a maximum of 2 years.

If not, the proverbial ship would have long sailed off over the horizon…

So let’s do just that, even if it’s based exclusively on the basis that if someone can’t prove it’s impossible then it IS possible. And trust me, I REALLY do believe it is entirely possible and I personally will be doing everything I can to convert any “non-believers” into true believers.

(These may sound like the words of Billy Graham , and whilst its widely known I am of the Christian faith, this has absolutely nothing to do with religion, alchemy or “hocus pocus” of any kind whatsoever and is purely scientific and mathematical (i.e. probability) in its nature. Note: I am not suggesting that religion is a form of “hocus pocus” by any means).

Getting everyone “on the same page” may not actually be as difficult as it might first appear, largely because there has been another recent spike in all manner of highly sophisticated and modern looking real-world apps being released and developed in-house in companies all over the world.  The actual number is not officially available but I would wager it is far higher than what most people would expect, simply because much of the action is happening behind “corporate firewalls” so non-Oracle employees rarely get to even know of their existence.

Also, there are already many high profile and highly charismatic gurus/evangelists of JavaFX that let their actions do the talking.

If you don’t already do so, I strongly suggest you subscribe to Oracle employee, lead developer of official JavaFX controls and main author of the highly polished (external) controls library ControlsFX Jonathan Giles’ blog on http://fxexperience.com and his weekly post containing ( usually ) links to all the articles/announcements related to JavaFX from the preceding week each Monday.

Once we have taken this first baby step towards our end goal, the next step is to stimulate, encourage and nurture collaboration from as many developers as possible.  Well, this may even be an automatic progression from the first step, as once the confidence and belief in people becomes tangible, it’s only natural for many people to immediately and keenly want to get their hands dirty and dive right in with any spare time that they may have to contribute to OpenJFX and/or in releasing their own libraries/tools/frameworks etc. to ramp up the velocity a notch or two.

For anyone who does not automatically make this progression then it’s up to people like me and all the other JavaFX bloggers out there to pump out as much valuable & inspiring content as possible and as frequently as possible to the extent that the community is literally flooded with great code samples, demo apps, tips & tricks, solutions to common gotchas and even just words of positivity that they fall under the spell and become assimilated into The Collective where “resistance becomes futile”.

The Competition

It goes without saying that to be “number one” at anything, you have to be able to beat all competitors.

So exactly who or what are the competitors to JavaFX?

Well, while many may disagree, I firmly believe that (thankfully) there is only one true competitor and that’s the comprehensive & presently very successful C++ based graphics (and general) toolkit Qt . Unlike some, I have never and probably will never see the web technology stack of HTML5, CSS 3 and JavaScript as even a remotely a true competitor to JavaFX.  The two can and do co-exist peacefully, essentially because they mostly fill different niches. I have often said that “HTML5 is for building web sites, JavaFX is for building apps) and while the lines maybe somewhat blurred, I still believe these are fundamentally quite distinct concepts.

OK, so that we have identified out competitor, clearly we then need to get to know what they have that we don’t, what we can do better than they can do and any weaknesses they may have.

At the moment there are many things that Qt can do that JavaFX simply can’t even come close to.  For a start, the product is much more mature overall, much more feature-rich and also much more prevalent in the real world than JavaFX is.  The maturity & current lead in prevalence are largely irrelevant and clearly the main struggle will be to match the Qt feature set or even surpass it.

I would say that the biggest features that are in Qt but not in JavaFX and absolutely must be are:

  • Advanced 3D support via a 3D Canvas control
  • Support for WebGL (which they currently have both in their web view which is based on Blink rather than WebKit and also in the the 3D Canvas itself)
  • Better and more advanced support for mobile platforms
  • A web view that allows for true 3D graphics to enable not being restricted to supporting only limited versions of such key web technologies such as Google Maps
  • The capability to produce true high performance, sophisticated and graphics rich 2D & 3D games, scientific visualisations, animations etc.
  • An back-end-agnostic “maps” control that can be used outside the context of a browser
  • A GUI design tool in their Qt Creator IDE vastly superior to Scene Builder (currently)
  • Lots of 3rd party plug-ins or libraries for things like a true games and physics engines

Clearly there is some overlap there.  For example, simply switching to Blink as the basis of the JavaFX WebView or enabling hardware acceleration in the existing WebKit version would immediately buy us (for free) advanced 3D capabilities simply by supporting WebGL (which in turn is further supported by numerous JavaScript libraries that would also come for free).

But, it’s not the features of the Qt framework we have to address; the real key advantage that Qt has over JavaFX is the presence of The Qt Company which is a commercial entity that basically does nothing else other than developing, enhancing, supporting and providing other services of/for Qt. This is in stark contrast where we are now with JavaFX ( More on that later ).

Our Own Weaknesses

Obviously, another issue to address for beating your competitors is to identify and eradicate your own weaknesses.

I see the major weaknesses of the current JavaFX toolkit itself as:

  • Unexplained poor performance (possibly due to an inefficient rendering pipeline or heavy lifting that could be better done on the GPU happening on the CPU instead)
  • Poor/incomplete HTML5 compatibility in WebView
  • No real support for developing a full spectrum of applications, especially high performance games and 3D visualisations/animations etc.
  • A lack of easily integrated games or physics engines
  • Extremely rudimentary 3D support
  • Still not mature or fully viable support for mobile and embedded platforms

Our Own Strengths

Finally, to beat your competitors is to be aware of your own strengths and maximise their value to gain a tangible edge.

Thankfully, JavaFX has one very significant strength when compared to Qt and it is right under our noses: the Java language, platform & ecosystem themselves. Take it from someone who has done a fair amount of coding in both Java and C++, possibly the one issue on which Linus Torvalds and I see eye-to-eye is that C++ is a truly abhorrent programming language for so many reasons.

Sure, C++ has it’s niche and will be around forever but the tired old adage that C++ is better than Java because Java is soooo much slower has been addressed and dispelled years ago. Java’s performance has come along in leaps and bounds and is actually faster than C++ in certain circumstances owing to its ability to “adapt & improve” at run-time to the prevailing OS and hardware platform.

I think most people now don’t even both trying this ancient performance con to prove C++ is better than JavaFX because we have gone from the early days of Java where comments such as “It’s nowhere near as slow as Java” to “It’s not significantly slower than Java!”.

The real reasons why being able to code your application in Java is better than with C++ are:

  • Much better language design with OOP features not bolted-on to a pre-existing procedural language
  • WORA and the whole “cross platform compatibility” and “single code base” thing
  • Much more robustness due to the lack of pointers and large swathes of undefined behaviours in C++
  • Much greater productivity thanks mainly to automatic garbage collection but also due to more sophisticated IDEs and build pipeline tools
  • No need for multiple compilers, dialects etc. all of which are not totally compatible on different platforms (or even on the same platform)
  • Much cleaner and simpler language syntax than the almost impossible to ever fully understand or maximise utilisation of all features in C++
  • The plethora of mostly open-sourced, 3rd-party libraries available for just about every conceivable requirement

There’s really little need to go into any other strengths that JavaFX itself has as I believe it’s Java that is the most useful key to winning against Qt in the long run.  It really is a HUGE advantage.

The Impediments

What are the main impediments standing between us and achieving our goal?

Well, given that I am already not exactly Oracle’s favourite JavaFX personality (quite the opposite actually), I am not afraid to say what I think most people already realise anyway and that is that by far the biggest impediment is Oracle the company (and some of their staff).

For a start, Oracle has very, very clearly positioned themselves as a “cloud oriented” company now.  JavaFX has nothing to do with the cloud.  In fact, I would not be surprised if JavaFX is responsible for even a single dollar of revenue for Oracle each year. Also, the only product I am aware of that is either used by Oracle or is associated with Oracle that actually makes any use of JavaFX is JMC (Java Mission Control) as opposed to Java itself which is used extensively. One is certainly better than none! [Thanks to Marcus Hirt for this precious piece of information].

Nothing could make this any clearer than this relatively recent “word cloud” released by Oracle themselves:

JavaFX: Call to ARMs

Can anyone actually even spot the word “Java”?  Obviously, just don’t bother looking for “JavaFX”. I often joke that Larry Ellison has probably never even heard of the word “JavaFX”

One has to ask oneself, why would a so distinctly cloud focused company have any interest at all in JavaFX? Oracle are renowned for being one of the most profit focused corporations in the world, so I don’t even really understand why they maintain a (seemingly ever dwindling) team to develop JavaFX, each of whom must earn a fairly decent salary when they are not reaping any rewards financially or otherwise from the JavaFX product itself? You could be forgiven that being a worker on that team at the moment must feel something like a passenger on the Titanic, after it hit the iceberg.

And the other evidence already presented such as abandoning Scene Builder and official ARM support and the fact that I am struggling to see any major enhancements to JavaFX in Java/JavaFX 9 other than Jigsaw integration without doubt shows Oracle is only very slightly interested in JavaFX (at best) and that it is seemingly inevitable that ultimately (and maybe sooner rather than later) they will distance themselves from the whole product entirely.

But… on the flip side, this may turn out to actually be the best thing that could possibly ever happen to JavaFX.  After all, it amounts to removing the major impediment and puts the community in full control over the destiny of JavaFX.

My final word on Oracle is that whilst it’s true that overall the company is an impediment to the viability of JavaFX, I am absolutely certain that the developers past & present who have worked on the JavaFX team are some of the most outstandingly talented, dedicated and hard-working people you are ever likely to meet.  This is not about them.  They have not failed. They have done everything that they could possibly be expected to do and then some.  It must be a priority for the broader community to ensure we do not lose any more of these experts from the JavaFX ecosystem as they have the intimate knowledge down to the bare metal layers and this brains trust is vital to the success of JavaFX. I cannot stress this point enough and I would like to thank them all for the amazing work they have done and wish them everything of the best for the future.

The Strategy For Success

OK, so we have a lofty goal, a highly motivated and global collective of JavaFX & Java developers, we know who our competition is, we recognise our own weaknesses and capitalise on our strengths so how do we use all that to actually reach our goal in the shortest time possible?

Well I remember a saying from my childhood that my mother used to often quote that goes “Look after the pennies and the pounds will look after themselves”.  (This quote came from a time prior to 1966 when Australia adopted its own currency – the Aussie Dollar – over the old British Pound currency).

This saying seems to me to contain the key component of our winning strategy and that is that every individual must do their very best to contribute in some way and then the collective itself will just naturally improve and eventually succeed.

Some of the possibilities are:

  • Submitting bug reports to the broader OpenJDK project
  • Fixing bugs in said project (that relate to JavaFX of course)
  • Releasing your own JavaFX products or libraries
  • Starting a local JavaFX user group or Meetup in your town or city and then inviting JavaFX luminaries to speak and give presentations on particular topics
  • Spreading the word evangelist style that JavaFX is awesome and that everyone should jump on board the train
  • Inspiring your colleagues or employer to adopt JavaFX for their next project
  • Learning as much as you can about all the features of JavaFX and work up to becoming a “guru” who then passes on the knowledge to all your connections
  • Contributing to the work that Gluon are doing so well
  • Creating your own JavaFX blog and praise the heck out of it to everyone who subscribes
  • Attending JavaOne and any other Java or JavaFX related conferences globally and maybe even become a presenter

It would be helpful to have some kind of overall “coordinator” rather than a “leader” who manages and optimises the collaborative efforts. Which leads to my next chapter…

How Will Bembrick Software Labs Contribute?

Well, I guess I am the man to address this question

Bembrick Software Labs is a small, agile start-up that I co-founded where I effectively function as Lead Developer as well as you could say CEO. But putting labels on my role(s) is not important. We are all essentially peers without the burden of a corporate hierarchy.

What is important is the various activities we are involved in and the ways we intend to contribute.

These include:

  • Building and releasing our own free and commercial products built with JavaFX
  • Providing top-notch support services to all our customers
  • Creating our own unique JavaFX training courses targeting multiple levels of expertise and providing them to the public or in-house within specific businesses
  • Providing JavaFX consultants and consultancy services for short-term contracts, problem resolution, assistance in getting started with JavaFX and cutting lots of code where required
  • Setting up a GitHub project to allow our JavaFX Feature/Platform Matrix (which will be known as FXMatrix ) to be populated & maintained by the entire community instead of the original idea of hosting it as an Excel spreadsheet. Thanks to “Manuel” (sorry, I don’t know your surname) who suggested this brilliant idea in the Comments section in the original post at the link above
  • Updating this blog as often as possible with actual code samples, demos etc.
  • Enthusiastically promoting JavaFX to anyone who might be interested and/or be willing to get involved in some capacity
  • Offer to fulfil the role of “Coordinator” to oversee, manage and optimise the entire collaborative process

Conclusion

The number one priority is for all of us to get moving and moving as fast as possible, as soon as possible.

We have a goal which admittedly is setting a very high bar. But it’s all about believing in ourselves and each other and getting down and dirty.

I am not in this for financial gain as I am not and have never been motivated by money. What motivates me is helping others, creating something new even if it’s from nothing, solving the unsolvable problems, breaking new ground in technology and learning, learning, learning…

But, mostly my motivation right now is exactly as I said before, which I believe should be our official Mission Statement :

Facilitating, maturing and evolving JavaFX into THE premiere toolkit for cross-platform graphical apps of ANY kind.

IT IS ACHIEVABLE!

But… only if every one of us plays a role and contributes in some way.

How do you motivate yourself? Well, you could try to do what I do…

Every day visualise the day when the mission statement is fulfilled and you have played a role in producing the best product in its class in the entire world and you and everyone else actually benefits from your efforts. Be motivated by the desire to help other people and businesses achieve their own goals and not focus on yourself or purchasing your own private jet.

This is not to say you won’t be rewarded. The rewards may not be financial but they will be much, much better than anything money can buy.

Make it so. Number One, engage!

Just my 2 bits,

Felix

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » JavaFX: Call to ARMs

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址