2

Im Tryinig to create a networking Java SE application with a user-friendly interface, im so confused about the GUI library (Swing, SWT, JavaFX) and also about the architecture of the application (MVC, PureMVC) can any one, with experience, give me a suggestion about all this, I would be so grateful.

I heard about Griffon but without a good documentation I can not get started.

PS: I google it but nothing interesting.

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
imanis_tn
  • 1,150
  • 1
  • 12
  • 33
  • 3
    I'd suggest Swing (which uses a form of MVC). It is the primary tool-kit used by Java desktop developers so (ignoring all other potential benefits) you are likely to get more help with it when you ask a specific question. On the subject of specific questions, this isn't one, so voting to close. – Andrew Thompson Mar 23 '12 at 10:35

5 Answers5

1

Grails is a framework for creating web applications, so if you're trying to create a Java SE (desktop) application, you can forget about Grails.

However, there is a desktop application framework called Griffon that uses the same language as Grails (Groovy), which should be easier than using Swing or SWT.

Dónal
  • 185,044
  • 174
  • 569
  • 824
  • Just to be clear, I say "should be easier than Swing or SWT", because if it isn't, the whole project is fairly pointless. I don't have any personal experience of using Griffon, but if I was building a desktop application, it would be my first port of call. – Dónal Mar 23 '12 at 10:27
  • Sorry i have motioned Grail by mistake in place of Griffon. i have a look at Griffon but i found that it have Groovy as the primary language, and in my application all the logic have already written in the JAVA. – imanis_tn Mar 23 '12 at 10:43
  • Groovy may be the primary language in Griffon but it's not your only choice, it's possible to create an application in 98% Java http://griffon.codehaus.org/guide/0.9.5-rc2/guide/13.%20Tips%20and%20Tricks.html#13.2%20Dealing%20with%20Non-Groovy%20Artifacts or Scala http://jroller.com/aalmiray/entry/the_griffon_trove_adding_scala Checkout the different language plugins that are available in Griffon http://artifacts.griffon-framework.org/tags/plugin/polyglot – Andres Almiray Mar 23 '12 at 19:36
1

This are at least three question, a single answer is unlikely to cover all aspects

a) What about GUI-Lib

With any detailed information about your requirements it is hard to say which fits better and why. In short

Swing is pure Java, maybe some what slow, but running where java is fully available (not android for example)

SWT is os-aware, used by eclipse for example. Looks like the os appear and seems to be much faster. Good for Windows, Linux, Mac

JavaFX is not commonly used. As far I know it is required to learn a further language. I have never seen an JavaFX app

b) What about architecture and libs MVC could be a real good concept. However, there so many different opinions about what MVC really is.

pureMVC is a lib supporting an interpretation of MVC

c) What about Grail There are already answers about this aspect.

When you mean with "networking app", client server apps with browser front end, there are lots of technologies supporting this.

  • GWT
  • Captain Casa (JSF)
  • Wicket
  • IceFace (JSF) ... (I guess you will find about 40 technologies in the area)

However, the backend is no more Java SE in such cases.

The are no simple answer (no, there is NO "the best"), you have to investigate your needs, technical implication and than choose the right or better known technology.

This is a hard job without a short cut. Any other approach is gambling, you may win, but usually you lost

stefan bachert
  • 9,413
  • 4
  • 33
  • 40
  • Thank you for the detailed answer. I motioned "networking app" because my app deal with routers and network equipment and work with SNMP, TELNET, HTTP ...etc so its not a server side application. And i have asked all those questions because i found it so hard to deal with many class in the application without a detailed architecture that guide you. – imanis_tn Mar 23 '12 at 10:56
0

Grails it's server side framework, designed to build web application. So, if you're making desktop app (event n-tier app, with some central server), it doesn't good here.

Anyway, you can find official Grails documentation here: http://grails.org/doc/latest/ (as for me it's very detailed)

Also, if you're really need a framework to build some server for your desktop app, I can suggest you to start with Spring Framework / Spring MVC. It's easy to make an REST JSON/XML/SOAP/Protobuf/etc/etc server based on it. Btw, it's much more low level, and you have to choose all other technologies and libraries that fits your needs. Like choosing JSON serializer, database mapper, etc

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
  • I'm not so sure that Spring MVC is a better solution than Grails for building the server-side of a desktop app – Dónal Mar 23 '12 at 10:28
  • It's much much easier to make restful services using just spring, it's more flexible here. And also, 90% of grails fatures not requred here. – Igor Artamonov Mar 23 '12 at 10:33
  • Btw, it's really depends on your experiecem. It's always better to use well known solution (I'm sure that for a lot of people PHP is much better for restful server, that spring or grails) – Igor Artamonov Mar 23 '12 at 10:35
  • My application is just a simple desktop application without a server side, sorry because i don't make my question so clear, and i have also motioned Grail by mistake in place of Griffon. – imanis_tn Mar 23 '12 at 10:38
  • Ok, got it. I heard that Griffon is good, i've never used it, so, cant say anything objective here. – Igor Artamonov Mar 23 '12 at 10:42
0

GUI: JavaFX is dead, don't use it. SWT is hairy and to low level - you won't use it. Swing is way to go (also you can customize is with L&F like substance) if you dislike built in Look&Feels like Metal.

lzdt
  • 489
  • 1
  • 6
  • 17
0

Btw, every Grails application is an Spring MVC application, so every +1 you give to Spring MVC applies to Grails as well.

Andres Almiray
  • 3,236
  • 18
  • 28