views:

76

answers:

2

Hi, I'm currently facing a need of creating user frontend application to database with dozens of tables and thousands of fields.

It should be java swing application, and I'm trying to find as most automated solution as possible. Ideally to completely avoid manual creation of DAO layer, beans definition and GUI creation.

Currently we are discussing the possibility of transforming database to set of XML documents, so the solution should include the capability of working with both, relational database as well as XML documents.

Any ideas / experinece?

+2  A: 

This is a complex topic that might make a good Community Wiki. I've only scratched the surface, but NetBeans has an evolving capability in this area. It should be on your short list. See these help topics & links:

  1. Generating JPA Controller Classes from Entity Classes
  2. Binding Data to a Swing Component
  3. Java Persistence Tasks: Quick Reference.
  4. Best Practices with JPA and Beans Binding.
trashgod
+1  A: 

There are really two steps:

1st is to choose an object relational mapper (ORM). This can be a JPA provider, JDO provider, or something like Hibernate. JPA is the language supported specification for mapping between your Java objects and your database. I have also used Hibernate (Hibernate is confusing because it is both a stand alone ORM and a JPA provider) and it has worked well for me. Your ORM will describe what tables/rows you store your Java object's classes/fields into and it will also provide transactions and a mechanism to persist your Java object changes when it is convenient for your application.

If you are thinking about storing to XML then you may want to look at DataNucleus as a JPA/JDO provider which has early support for xml storage.

2nd is to choose your binding framework. If you are using Swing then the NetBeans platform is a natural choice as trashgod suggested. NetBeans has a whole slew of technologies meant to ease your application development including binding technologies. If you use the NetBeans IDE then you get a GUI creation tool built in. I have no experience with the GUI creation tool so I can't say much more than it exists.

If you are doing a straight Swing rich client to database then you do not need to use DAOs. DAOs are useful in multi-tier apps where there is code on both the client and the server. If you are running all your logic on the client and the server is just a database then you do not need DAOs.

rancidfishbreath