views:

496

answers:

9

Hello everyone !

For almost a year know, i developped applications in EJB3/JPA for persistence and business and Seam/JSF for presentation.

I had an idea for a desktop app, but i don't know what to use.

Using an embedded jboss would be the easy thing, because i don't have to change the way i code, but it's not realistic, and i don't think it would work well.

So, is there someone who could show me the path to a good and easy to do desktop app ?

Thanks :)

Edit : I think i'm not clear enough, sorry.

I don't need the list of possible options for GUI or Data Access or Business layers, but the easiest ones when you know ejb3 jpa seam jsf etc..

Thanks

EDIT 2 : really i was tired :p Seeing all the different answers i realized i should have been more explicit about what i want, sorry!

I want to develop, for a personnal interest, a desktop application, standalone, for one user with embedded database like hsql, and pack it like any .exe application. There is no connection to the internet, it really is local.

I know java is probably not the best way to do that kind of app, but i can't take the time to learn C# as well as i know java.

So, i know JPA/Hibernate, EJB3 and the only way i know doing GUI is webGUI.

I know i can't use ejb and web in a desktop/local/standalone app, so i know i will have to learn new frameworks.

Right now, it seems that Spring + JPA + Swing should do the trick, but i was afraid the transition between what i already know and those framework would be too time consuming.

My app is rather small, i'd say one week of work, so the learning part can't take 2 or 3 months..

Using jpa, which i already know would be cool. Spring does basically the same things ejb3 does. I still don't know about Swing.

Anyway, i am really sorry i asked my question the wrong way.

Any advice is welcomed

Thanks again

EDIT 3 :

i searched, and i found that Adobe Air fits with what i want for the front, more than Swing does : the ui part (mxml) is very similar to jsf, and i can use css for styling and branding my app.

I still don't know what to use for the java part between plain java or spring, though.

(sorry it took so long decide)

+1  A: 

Well, you could always learn a new language.

Brian Schroth
i will have to learn a new framework, that's what i mean, but the idea is to do it in java
Maxime ARNSTAMM
Well, you may end up deciding to do it in Java, but you shouldn't discount all other languages just because you haven't learned them. At least weigh the potential benefits against the potential downsides.
Brian Schroth
finally i will do it in pure air : the mxml part is similar to jsf and AS is not very difficult when you know java
Maxime ARNSTAMM
A: 

It depends of how complex is the application you have in mind but the in my opinion the easiest way is to learn Swing or JavaFX since you already know Java.

In the other hand, if you mind about cross-platform compatibility you might learn C# and target the application to Windows users, C# is very similar to Java.

UPDATE

After looking at your comments, my short answer is you can't. EJB is just supported by 'heavy' application servers like JBoss or WebLogic, the only thing that comes to my mind is to use Spring/Hibernate without EJB and have an embedded servlet container like Jetty or Tomcat. This way, for the view you'd use JSF/Seam

Here an interesting article in DevX about Jetty and Spring

victor hugo
Is the transition between ejb3/jpa and spring/hibernate difficult ?I thought of this, but i don't know anything about spring..
Maxime ARNSTAMM
Is not difficult at all, Hibernate supports JPA annotations. I said Spring as an example though.
victor hugo
A: 

With you java knowledge, you have three choices, Swing, SWT or JavaFX. It depends on what the purpose of your application is and what it needs to do to be able to advise between those options.

If this is really only going to run on good old fashioned Windows, and you are going to be back on SO asking how you acccess this windows native service or that windows native service from Java, then do it in C#.

Yishai
Haha, almost the same answer but I sent it 20 sec before you
victor hugo
C# is not an option.The GUI layer is not my only concern : for the data access layer, should i use hibernate directly, or spring, or is there some way to use ejb ?i should edit my original question, i think i wasn't clear enough
Maxime ARNSTAMM
+1  A: 

An easy way to get up and running fast would be to use Netbeans' built-in Desktop Application Template, for which there is a tutorial here.

It is based on the Swing Application Framework, and comes in two flavors: standalone desktop app and CRUD-based database desktop app.

What's nice about it is that the template provides you with a GUI app infrastructure with a menu, main window, about box, and status bar with a progress bar that'll work with any action you subclass, meaning you can create actions and running them will trigger the progress bar without you having to write a line of code.

Another nice thing about it is that NetBeans provides you with a drag and drop visual editor so you can build your app visually. But at the same time, it will generate 100% Swing code, so you can examine the source and see what it generates. Now if you actually like spending your time writing hundreds of lines of code to display a couple buttons and drop-downs, then you don't have to use it, but still... ;-)

JRL
A: 

Griffon is a Groovy based application framework for building desktop apps. It looks like a great way to build up the Swing plumbing for your application quickly.

As far as what backend you'll want to use depends on how many users you are expecting. If you want this to handle lots of load, you can have a server component running and have all of the client machines do data access via some kind of remote method calls. Spring Remoting has a lot of easy to use options if you go this route. You can then leverage your JPA knowledge on the backend.

Otherwise, every client will have to make a connection to the database, which won't scale very well. In theory you should be able to use JPA within a Java client program, but you probably will have to do some extra work to get it working. EJB3/JPA was designed to be usable outside of a container, so you should be able to use Hibernate or EclipseLink without having to embed a J2EE appserver.

When I've created desktop apps to talk directly to the database, I've just stuck with using JDBC through Spring.

Jason Gritman
+1  A: 

You could write a "desktop" app that runs in the browser using the Google Web Toolkit. This would use some of the same backend technologies that you already know (JPA etc.). As a bonus you get to re-use your HTML and CSS skills and the "desktop" app can run anywhere. GWT apps are a lot "cleaner" that normal Java web apps - for one thing the server can be stateless as all state can be maintained on the client. No sessions etc.

David Tinker
A: 

Use Swing. Learn the basics here: http://java.sun.com/docs/books/tutorial/uiswing/

Then learn to use the GUI designer in Netbeans: http://www.youtube.com/watch?v=LFr06ZKIpSM

Thorbjørn Ravn Andersen
+2  A: 

Swing or SWT aren't bad options. If you have the design experience, just think of the desktop like you would a view that contains controls which trigger events which have to be handled by the controller. Spring/Hibernate is a good tool to use for your models support for persistence but you probably already ran into that one, which makes it that much simpler.

You are underestimating your experience and overestimating the difficulty in getting started with the GUI packages.

Start by writing something drop-dead simple and then keep modifying it. Eventually, you'll see where you can take the app towards where you want to go; it'll be downhill from there.

Kelly French
A: 

You can start with Netbeans Swing Gui Builder that can help you generate gui stuff visually. Some help you can find in appropriate JavaPassion classes.

Using JPA with Swing is not a problem too.

cetnar