I have read the Wikipedia article on JavaFX and several other articles and I believe I have a decent understanding of what it is and what it does.
My question is simple: what do Java EE best practices dictate one uses for the presentation? Or, is it possible to use them both? Either way, can someone give an example of when it would be appropriate to choose one over the other, and why?
Thanks for any help with this; I'm just not seeing why anyone would ever want/need to stray from JSF.
JavaFX and JSF are two very different animals. I think of JavaFX as Oracle's version of Adobe Flex (or Flash?). It runs on a JVM, which means it's a heavier client for the browser. JSF uses standard HTML controls and interaction.
Running in a VM, like JavaFX or Flex means that you don't have to worry as much about browser capabilities like you do with standard HTML/Javascript, but it also means you are at the mercy of the VM implementor to get the platform on browser XYZ and fix platform and security bugs as they arrive. Another consideration is that some corporate environments may not like allowing plugins like flash/java in the browser.
Running pure HTML/Javascript will likely get you going on more devices and is lighter weight than needing to load a VM into the browser (never thought I would call JSF 'lighter weight'.) jQuery and other javascript frameworks have lessened the worries about cross-browser compatibility somewhat but not completely.
So, the answer is the same here as it is for every other question like this: "It Depends." What are your needs? Are you doing an annoying restaurant website where you feel like the menu (even though it's just an image) needs to be loaded by a heavy plugin? Perhaps JavaFX will fit the bill. Are you doing a simple CRUD app and you want to complicate things by using a difficult component based framework? JSF can help you with that.
JSF is pretty rich in UI compared to spring or struts but has a jargon of maintaining session and additional jars. But if you use richfaces, ibmfaces or primefaces your life will be much easier. JSF is a specification and you need to use its implementations like richfaces or myfaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With