Hi, everybody.
My work has tasked me with coding a new record keeping system for them, and I've started the task in Java. We have Oracle, and I got the JDBC connectors working all properly.
My question was about data input forms. We've got a lot of forms (and I mean a LOT of forms!), and some of the forms can be quite lengthy. I started hard-designing the forms in the Netbeans visual editor, but then quickly decided this is not the best way to do this.
Here are my thoughts, and I wanted to get your expert opinions on this. I wrote myself an XML template that defines the fields of the form, what data types they are, and whatever custom attributes each field should have. I used a DTD template to make sure that all my XML form specifications validate. Next, I'm going to write some Java code that parses the XML form specs, and generates the Java controls on the form. I would also like to reuse the XML file for other things, such as defining the Oracle table structure and in the creation of SELECT statements for report generation.
My question is, has anybody else done anything like this in the past? When it comes to DB input forms, what are the best known practices? Are there any problems I'm going to run into that I didn't think about using my above technique?
Back in college, they only taught us with extremely simple examples, and so we were never prepared for a real-world complicated problem like this. Seems there should be a better way than to hard-code all the forms. Anybody have a different technique that's worked well for you?
2 replies to this topic
#1
Posted 16 March 2011 - 06:04 AM
|
|
|
#2
Posted 16 March 2011 - 04:41 PM
First, I would avoid programming with the JDBC API. I would use JPA and Hibernate instead. You are going to have a significant reduction in the code you have to write (and eventually debug and maintain). Also, I'm not sure I would generate the UI from XML configuration. My experience doing that sort of thing is that it's hard to debug and maintain. The reality is that these things don't change much. If someone has to maintain your code it may not be obvious to them that to debug the application they have to look at a custom XML config file.
You don't specifically state but it sounds like you are doing a Swing front-end. I would look at a framework called Griffon. It's based on Groovy, which is a scripting language for Java. It's easy to learn and runs on the JVM. The Griffon framework will speed up development: Griffon - Home
You don't specifically state but it sounds like you are doing a Swing front-end. I would look at a framework called Griffon. It's based on Groovy, which is a scripting language for Java. It's easy to learn and runs on the JVM. The Griffon framework will speed up development: Griffon - Home
#3
Posted 17 March 2011 - 06:09 AM
Thanks for the tips. I haven't heard of JPA and Hibernate (We were taught JDBC in college), and I'll give them a look. I'm always a little hesitant to learn a new framework, because that takes time, and I'm really being pressured to show some results. But I'll take a look at what you mentioned and see if it's something that will save me time.
Anybody else have a thought on this or a different idea?
Anybody else have a thought on this or a different idea?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









