Best way to automatically bind data between database and user interface in java swing app?

Currently, I am faced with the need to create a user interface for a database with dozens of tables and thousands of fields.

This should be a java swing application, and I'm trying to find the most automatic solution. Ideally, completely avoid manually creating a DAO layer, defining beans, and creating a GUI.

We are currently discussing the possibility of converting a database into a set of XML documents, so the solution should include the ability to work with both a relational database and XML documents.

Any ideas / experience?

+2
source share
2 answers

There are really two steps:

1st - select a relational object mapper (ORM). It could be a JPA provider, a JDO provider, or something like Hibernate. JPA is a specification supported by the language for mapping between your Java objects and your database. I also used Hibernate (Hibernate is confusing because it is both a standalone ORM and a JPA provider), and it worked well for me. Your ORM will describe which tables / rows store classes / fields of Java objects, and it will also provide transactions and a mechanism for saving changes to a Java object when it is convenient for your application.

If you are thinking about XML storage, you can look at DataNucleus as a JPA / JDO provider that has early xml storage support.

2nd is to select a binding structure. If you use Swing, then the NetBeans platform is a natural choice, as trashgod suggested. NetBeans has a host of technologies designed to facilitate application development, including binding technologies. If you use the NetBeans IDE, you get a built-in GUI creation tool. I have no experience with a GUI tool, so I can’t say much more than it exists.

If you are making a direct Swing rich client into a database, you do not need to use DAO. DAOs are useful in multilevel applications where there is code on both the client and the server. If you use all your logic on the client, and the server is just a database, you do not need DAO.

+2
source

This is a complicated topic that can become a good Community Wiki . I just scratched the surface, but NetBeans has developing capabilities in this area. This should be on your short list. See Help topics and links:

+5
source

All Articles