Spring和SWT可以一起用于Java桌面应用程序吗?

时间:2023-01-12 15:35:56

I am going to design Java Desktop Application. While I was design web application, I got plenty of choice, e.g. Spring, Strut etc. However, for Java Desktop (which is new to me), I don't find any.

我将设计Java桌面应用程序。虽然我是设计Web应用程序,但我有很多选择,例如Spring,Strut等。然而,对于Java Desktop(对我来说是新手),我找不到任何东西。

Is that Eclipse RCP a Java Desktop Framework, which works like Spring mvc in Web apps? I wonder, can I use Spring to enjoy the benefit of IOC, together with Eclipse RCP to enjoy the benefit of both world?

Eclipse RCP是一个Java桌面框架,它在Web应用程序中像Spring mvc一样工作吗?我想知道,我可以使用Spring享受IOC的好处,与Eclipse RCP一起享受这两个世界的好处吗?

Please advise. Thanks.

请指教。谢谢。

3 个解决方案

#1


In java desktop land, you have 2 major choices : Swing or SWT. I'm ignoring AWT on this one. QTJambi is not that used in Java.

在java桌面版中,您有两个主要选择:Swing或SWT。我在这个上忽略了AWT。 QTJambi不是Java中使用的。

Most Java desktop applications use Java Swing. Nothing is preventing you from using an IOC container in a desktop application. In general, IOC container are used mostly to store event listeners, actions in desktop applications and barely UI components.

大多数Java桌面应用程序都使用Java Swing。没有什么能阻止您在桌面应用程序中使用IOC容器。通常,IOC容器主要用于存储事件侦听器,桌面应用程序中的操作以及几乎不包含UI组件。

There are many attempts to create Swing RCP frameworks but most Java desktop applications kind of roll their own.

有许多尝试创建Swing RCP框架,但大多数Java桌面应用程序都是自己的。

#2


You definitely can use Spring and reap the benefits of its various features including IoC. Spring is definitely not confined to the webworld, that's one of its great selling features is it's the swiss army knife of Java frameworks.

您绝对可以使用Spring并从其各种功能中获益,包括IoC。 Spring绝对不仅仅局限于webworld,它的一大卖点是它是Java框架的瑞士军刀。

#3


You realize, of course, that SWT is not portable the way that Swing is.

当然,你意识到SWT不像Swing那样可移植。

Yes, you can use Spring with SWT, but there's no built-in MVC framework to help you. You might find the Spring Rich Client module helpful.

是的,您可以将Spring与SWT结合使用,但是没有内置的MVC框架可以帮助您。您可能会发现Spring Rich Client模块很有用。

Here's a simple example - one person's opinion.

这是一个简单的例子 - 一个人的意见。

#1


In java desktop land, you have 2 major choices : Swing or SWT. I'm ignoring AWT on this one. QTJambi is not that used in Java.

在java桌面版中,您有两个主要选择:Swing或SWT。我在这个上忽略了AWT。 QTJambi不是Java中使用的。

Most Java desktop applications use Java Swing. Nothing is preventing you from using an IOC container in a desktop application. In general, IOC container are used mostly to store event listeners, actions in desktop applications and barely UI components.

大多数Java桌面应用程序都使用Java Swing。没有什么能阻止您在桌面应用程序中使用IOC容器。通常,IOC容器主要用于存储事件侦听器,桌面应用程序中的操作以及几乎不包含UI组件。

There are many attempts to create Swing RCP frameworks but most Java desktop applications kind of roll their own.

有许多尝试创建Swing RCP框架,但大多数Java桌面应用程序都是自己的。

#2


You definitely can use Spring and reap the benefits of its various features including IoC. Spring is definitely not confined to the webworld, that's one of its great selling features is it's the swiss army knife of Java frameworks.

您绝对可以使用Spring并从其各种功能中获益,包括IoC。 Spring绝对不仅仅局限于webworld,它的一大卖点是它是Java框架的瑞士军刀。

#3


You realize, of course, that SWT is not portable the way that Swing is.

当然,你意识到SWT不像Swing那样可移植。

Yes, you can use Spring with SWT, but there's no built-in MVC framework to help you. You might find the Spring Rich Client module helpful.

是的,您可以将Spring与SWT结合使用,但是没有内置的MVC框架可以帮助您。您可能会发现Spring Rich Client模块很有用。

Here's a simple example - one person's opinion.

这是一个简单的例子 - 一个人的意见。