开发者

JSF vs JavaFX : Pros & Cons [closed]

开发者 https://www.devze.com 2023-04-04 10:27 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. 开发者_StackOverflow中文版
Closed. This question is opinion-based. It is not currently accepting answers.
开发者_StackOverflow中文版

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 9 years ago.

Improve this question

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消