Can Spring and SWT work together for Java Desktop

2019-04-06 10:59发布

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.

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?

Please advise. Thanks.

3条回答
家丑人穷心不美
2楼-- · 2019-04-06 11:12

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.

查看更多
成全新的幸福
3楼-- · 2019-04-06 11:27

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

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.

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

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-04-06 11:28

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.

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.

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

查看更多
登录 后发表回答