10

I was wondering if Spring MVC can be used to implement MVC pattern in Java Swing Applications. I've done some study and found Spring MVC to be used for web development.

Is there any way Spring MVC to be used with Swing Applications?

TheKojuEffect
  • 20,103
  • 19
  • 89
  • 125
  • As far as i know its a Framework to implement a mvc Pattern for Web Development (similar to what rails does). It has just a Little to do with the original mvc Pattern from the gof Book... So the awnser would be: no... – Mario David May 05 '13 at 15:48
  • Not a good idea, IMO: http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/mvc.html – Bhesh Gurung May 05 '13 at 15:52
  • More here on [Swing MVC](http://stackoverflow.com/a/3072979/230513). – trashgod May 05 '13 at 16:08

2 Answers2

7

Not really. As you say, Spring MVC (or Spring Web MVC) is primary targeted for web server development and thus have little to do with client side or standalone GUI applications.

That said, nothing prevents you from using ordinary Spring technologies for dependency injection, as a backend in your model, etc. Spring provides abstractions for persistence, remote network communication, transactions, security and so on that might come in handy in many projects.

Additionally, there is the Spring Rich Client Project that was released some years ago, but I do not know its current status.

matsev
  • 32,104
  • 16
  • 121
  • 156
3

No, but you may want to take a look at Griffon, which offers a Swing MVC framework base on Spring libraries and the Groovy language, which should be really easy for any Java programmer to pick up.

I've used it quite successfully to build rather large desktop applications for corporate clients.

Reg
  • 10,717
  • 6
  • 37
  • 54
GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67
  • If I use `Griffon` for UI development, Do I have to write all the codes in `Groovy`? Is it compatible with other `Java` codes? – TheKojuEffect May 06 '13 at 13:28
  • What is the best way to learn `Griffon`? Can you please refer to some materials that I can start playing around with `Griffon`? – TheKojuEffect May 06 '13 at 13:37
  • 1
    No, you don't have to write everything in Groovy - you can freely mix Java code in with it. For a quick intro, take a look at http://groovy.codehaus.org/Griffon+Quick+Start Griffon in Action is a very good book, written by one of the primary committers to the project - see http://www.manning.com/almiray – GreyBeardedGeek May 06 '13 at 15:39