tags:

views:

643

answers:

2

I'm a newbie to swing development.

I have a swing app that needs to access data from a remote sql database. The users of the app are all located in our office.

Is it bad practice to access the database directly from the swing app?

Should I put database facing code into an rmi server?

A: 

Do you have a plan for dealing with concurrent access to the same records in the database? It is something you will have to deal with, so if not from within the code, having all instances of the Swing application accessing the data via a central (i.e. your RMI server) location would make this much easier.

Elie
No, it's read only.
Ben Noland
The just tier your Swing application so that all your data access can be factored out later if you need to, and stop there.
Elie
+2  A: 

Not necessarily, but you'll want to 'layer out' the data access code in your application to make it easier to do later. It will also tend to make the rest of the application more maintainable.

Nerdfest