是否有人真的关心
Java
桌面应用
?
作者
Bruce Eckel
如果我明白有什么是对的,那应该是在
Java
One
大会上的主题
Java FX
之年。我惊讶于
Java FX
的敏捷与清晰。但是博客社区似乎对此缺乏热情。
Java UI
的历史中充斥着错误的决定,其中之一就是,以一个在发布前最后一秒才建立好的
AWT(
Abstract Windowing
Toolkit
)
包作为
Java UI
的开始。因为(别惊讶)语言的设计者并不认为
UI
在
Java
中很重要。据传,
AWT
包从设计到完成只用了一个月,这就不奇怪它是如此难以应用了。
AWT
的评价是
—
很多
BUG
且在所有的平台上的表现都相当的普通
—
这就让人对
Java UI
再无信任可言。直到精工细作很多年的
Swing
出炉
,
但也只不过得回一些失去了的魔力。用户们对第一印象有着很长时间的记忆,所以依然认为
Java
的
UI
界面是很蹩脚的,对他们而言,这冒着热气的咖啡杯看起来就像蒸汽。
当时这们语言坚决不支持组件和事件模型,
JavaBean
可不是这些组件,而是一种无力的尝试,试图弥补其中的空隙。一个正真的组件与事件模型,绝对不是让程序员或上下环境通过大量的代码来模仿。如果这样也可以解决,我们将不再需要抽象,我们将可以这样说:基本的图灵机将解决所有的问题。
用
Swing
从来就不是简单的事,而是很凌乱与复杂的。当人们尝试让
Java
像
Visual Basic
一样简单的时候,产生了许多的抱怨。曾经
Sun
有一个要把
VB
移植过来的计划,不过后来又放弃了。没有真确的下层体系结构,这事永远也不会发生。你也将在大量乏味的
UI
代码中结束。
基本上,
Java
中的
UI
程序员,都会后悔且很难适应,而不是正真的支持它。这样当人们谈到
Java FX
时的观望态度就不值得奇怪了。
有多少广为人知的
Java
桌面应用程序呢?好的,
Eclipse
算一个
,
这是一个开发环境
,
用的是自己开发的
UI
包建立的应用程序
,
因为
Java
在当时并没有满足它的需求。
NetBean
算一个
,
这也是一个开发环境
,
展示了
Swing
现在可以很好的完成任务了。
IntelliJ
也算一个,这同样是一个开发环境。但是我不知道有什么常规的
Java
桌面程式,尤其是有人买的。
人们不用
Java
创建桌面应用的原因,实际上是因为那彻底失败的
UI
。
我已学习
Flex on
与
off
有好几年了,我发现它真的是最全面的
UI
解决方案。特别是因为我没有使用单一的语言来做后台逻辑。
Flex
是作为一个用户界面语言来设计的。使用
Flex
来作为多语言程式的
UI
解决方案是很具有扩展性的,因为人们可以创建一个
AMF (ActionScript Message
Format
)
来沟通他们最喜爱的语言。
AMF
是理想的方法,因为它是异步的。可以很好的符合
UI
的使用范式。一般来说,你不会知道某个任务会耗时多长,而异步方法会保证你的
UI
总是可以做出快速响应,而不管真正的代码会运行多久。
在这篇文章中我将展示一个
PyAMF
的列子。
PyAMF
的项目很有效率、很容维护,同时提供了一个简单易懂的
Python
桌面应用的
UI
解决方案。
RubyAMF
项目同样很有效率。它可以建立
Ruby on Rails
应用程序的
Flex
用户界面。
(
未完成
,
后面的意义不大啦
)
If I understood it right, this was supposed to be the "year of Java
FX" at Java
One. We were going to be stunned by how clever and clear Java FX is.
Instead, there seems to be deafening silence in the blogosphere.
The history of Java UI is littered with disastrous decisions, starting
with the AWT (Abstract Windowing Toolkit
), which was created at the last
second, because (no surprise) the language designers hadn't considered UI as an
important paradigm for Java. Rumor has it that AWT was one month from
conception to completion, which certainly fits. The results of AWT -- buggy and
equally mediocre on all platforms -- destroyed everyone's faith in Java UI, for
so long that Swing, which has been baking for years and years, is only just
getting back some of the lost mojo. Users, who have a long memory of first
impressions, still equate Java with crappy user interfaces, so to them the
steaming coffee cup looks like something else that steams.
Then there's the steadfast refusal to support a component and event model
in the language. No, Java Beans is not that; it's a weak attempt to fill in the
gap. A true component and event model is far different from requiring the
programmer or environment to spew out lots of code to emulate it. If that was
the solution to everything, we'd never need abstractions; we might as well just
say that a basic Turing machine will solve all problems.
And Swing programming has never been easy, but always messy and
complicated. There were periodic murmurs of trying to make Java UI programming
as easy as Visual Basic; at one point, Sun even had a VB porting project but
abandonded it. Without the underlying infrastructure it can't ever happen.
You'll always end up with lots of tedious UI code.
Basically, UI programming in Java has always been an afterthought,
reluctantly accomodated but never really supported. It's no wonder that people
are taking a wait-and-see attitude about Java FX.
How many well-known Java desktop applications are there? Well, there's
Eclipse, a development environment, which created its own UI library because
Java didn't satisfy the needs at the time. There's NetBeans, a development
environment, which shows that Swing is now up to the task. And there's
IntelliJ, a development environment. But I don't know of any general desktop
apps in Java, especially ones that people pay for.
The reason people don't seem to create consumer and business desktop
applications in Java may in fact be the UI debacle.
I've been studying Flex on and off for several years now and I continue to
find it to be the best all-around solution for UIs, especially because I'm not
trapped using a single language for the back-end logic. Flex was designed from
the ground up as a user-interface language. The use of Flex as a UI solution
for multiple languages has been expanding because people have been creating AMF
(ActionScript Message Format
) bridge
s
for their favorite languages.
AMF is an ideal approach because it is asynchronous, so it fits well with
the UI paradigm. In general, you never know how long something is going to
take, and the asynchronous approach guarantees that your UI is always
responsive no matter what is going on.
I've shown an example of PyAMF in this article
.
The PyAMF project appears to be quite active and well-maintained, and provides
a straightforward solution for creating UIs for desktop Python applications.
RubyAMF
also seems to be a
very active project. It creates Flex user interfaces for Ruby on Rails apps,
but there was a presentation at the last RailsConf on "Powering AIR
Applications with Rails," so it would seem to support the desktop
paradigm, as well.
There's also an AMFPHP project for PHP
,
although this is not a desktop solution.
There is an OpenAMF
project for Java-Flash remoting
, but it appears to be dead, with the last
activity being 1.0 Release Candidate 12 in April 2006. The product doesn't work with more
recent versions of Java, and no one appears to be maintaining it. Which is
interesting because Java should theoretically be a much larger base and in that
vastness there should be a group of people who want this -- I certainly do.
Even more so because BlazeDS is open source and contains the core workings of
what you need to create Java AMF (BlazeDS itself is only designed for Java web
apps).
I don't know this for sure but I think at some point Adobe extended the
olive branch to Sun regarding connecting Java and Flex beyond BlazeDS, but as
usual, Sun couldn't see beyond their "not invented here" motto and
had to create something "better." So now everyone appears to be
taking a wait-and-see attitude, wondering whether Java FX is going to be
another "greatest thing in the world, just you wait" that never
materializes (perhaps Sun, in all of its tussles with Microsoft, has learned
far too much about that company's marketing practices).
My first preference would be that Adobe would create and maintain a
Java-AMF bridge for desktop applications, but perhaps Adobe considers Java a
server-only technology; in any event, desktop Java support doesn't appear to be
forthcoming from Adobe (I'd love to be surprised about that one). Perhaps their
focus is on competing with Silverlight (I'm definitely
waiting-and-seeing on Silverlight. Microsoft always promises big, but what they
actually deliver is often very different -- consider
Vista
).
So if people are really interested in desktop Java, prove it. Take the
work that's already been done in the open-source BlazeDS and create a desktop
Java-AMF bridge, so we can easily add AIR user interfaces on top of Java code.
That way you can have easy-to-create UIs now, instead of waiting to see whether
Java FX pans out.
分享到:
相关推荐
Java还具备强大的软件部署能力,无论是桌面应用还是企业级应用,都可以在Java平台上开发并部署。特别是对于企业级应用,Java提供了高稳定性和可扩展性,满足了大规模应用的需求。 #### 二、Java的历史、现状与特点 ...
总的来说,Java编程语言以其面向对象、跨平台、安全和高效的特点,成为了全球范围内广泛应用的编程语言,从桌面应用到大型企业系统,从移动设备到云计算,都有Java的身影。其历史、语言特性以及持续的创新,都证明了...
3. **Java 2 Platform**:1998年发布的Java 2 Platform进一步明确了Java技术的标准,包括标准版(J2SE)、企业版(J2EE)和微型版(J2ME)等不同版本,满足了从桌面应用到企业级应用再到移动设备等不同领域的开发...
RCP中文入门教程可能涵盖了如何使用RCP创建自己的桌面应用,包括界面设计、功能集成以及如何使应用程序独立运行的步骤。学习RCP有助于开发者理解如何构建具有丰富用户界面的应用,并能提供更好的用户体验。 入职前...
Java Standard Edition(JavaSE)是Java平台的核心,提供了编写桌面应用的基础。在这个贪吃蛇游戏中,开发者可能使用了Java的AWT(Abstract Window Toolkit)或Swing库来创建图形用户界面,这两个库提供了创建窗口、...
标题中的"记事本源码java-NotePad_CSD201"指的是一个基于Java Swing开发的简单...这不仅有助于理解Java GUI编程,还能加深对MVC模式的应用理解,对于初学者或希望提升Java桌面应用开发技能的人来说是很好的实践案例。
总的来说,这个"Swing仿Windows画图程序"是一个很好的学习素材,可以帮助开发者提升在Java Swing GUI编程方面的技能,了解如何使用Swing组件构建功能丰富的桌面应用程序,并掌握图形绘制的基本技术。同时,通过实际...
总的来说,这个Swing数据库客户端项目是一个实用的示例,展示了Java Swing和JDBC在构建桌面应用中的应用,同时也为开发者提供了一个实践和改进的平台。对于希望提升Java GUI编程和数据库应用开发技能的人来说,这是...
过去,移动应用程序努力向桌面应用程序看齐的两个领域分别是图形/媒体和数据存储方法。Android 通过提供对 2D 和 3D 图形的内置支持,包括 OpenGL 库,解决了图形方面的挑战。由于 Android 平台包括流行的开源 ...
1. **Java应用开发**:展示使用Java开发的各种应用程序,如桌面应用、Web应用或移动应用(Android系统主要是用Java开发的)。 2. **Java技术框架**:可能涵盖了Spring、Hibernate、Struts等流行的Java开发框架,...
CIM采用业内主流开源技术构建,易于扩展和使用,并完美支持集群部署支持海量链接,目前支持websocket,android,ios,桌面应用,系统应用等多端接入持,可应用于移动应用,物联网,智能家居,嵌入式开发,桌面应用,...
虽然SeetaFaceSO是为Android设计的,但类似的库在其他平台(如iOS或桌面系统)上也有应用。这表明其核心算法可能是跨平台的,可以在不同环境中部署。 9. **API设计**: 作为一款JNI库,SeetaFaceSO应该提供清晰的...
【电脑管理系统】是一个基于Java开发的图形用户界面(GUI)应用程序,它实现了基本的数据管理功能,如添加、删除、修改和查询。这个系统利用了面向对象编程的核心概念,包括类的继承、封装以及多态性,这些都是Java...
C#是微软开发的一种现代、面向对象的编程语言,主要用于.NET框架,常用于桌面应用、游戏开发以及现在越来越流行的Unity引擎。 “使用授权免费使用此软件”意味着用户可以免费下载和使用这款工具,无需支付任何费用...
综上所述,WeatherApp的开发涵盖了Java编程、GUI设计、网络通信、数据解析等多个核心领域,体现了Java在构建桌面应用中的强大能力。通过学习和理解这些技术,开发者不仅可以创建出WeatherApp这样的实用工具,也能...
Swing作为Java的一部分,使得开发者可以创建具有丰富图形界面的桌面应用,而不必关心底层操作系统的具体细节。 在【压缩包子文件的文件名称列表】中,"emrecanderin_swing_demo-main"可能是项目的主目录或者入口点...
每个模块都有对应的Java接口,其具体实现称为后端,分别针对不同的平台(如桌面、Android),开发者只需关注公共接口,而无需关心底层细节。 #### 三、搭建Libgdx开发环境 1. **下载并安装**:首先从Libgdx官方...
ROM 在许多设备中都有应用,如计算机的启动程序、手机中的固件等。由于 ROM 的内容通常是不可更改的,因此它非常适合用来存储关键的系统级数据。 ### 10. 视图的定义 **知识点描述:** 视图是数据库中的虚拟表,它...
ActionScript 3.0是其最新版本,提供了更强大的面向对象编程能力,广泛应用于网页游戏、动画以及桌面应用开发。EditPlus的AS语法高亮文件可以确保在编写ActionScript代码时,关键语法元素如类、函数、变量等都能得到...
1. **Java Swing**: Java Swing是Java的标准GUI库,用于构建桌面应用程序。它提供了丰富的组件集,如按钮、文本框、面板等,而`jautocomp`就是基于Swing进行扩展,增加了自动完成的功能。 2. **自动完成文本字段**:...