views:

46

answers:

2

As one of the features in an in-house testing tool I'm interested in allowing the user to view the fileds' values of Java objects in a graphical way.
So, as far as I understand, the object's class needs to implement Serializable -and according to Effective Java book, preferably the custom form of the read/write methods.

This way I can use the serialized version of the objects as input for the viewer (this is more for after-run comparisons and regression-type comparisons with other runs rather than run-time viewing)

  1. How does one go about implementing something like this,especially as I have close to zero experience in developing Java GUI applications?

  2. Are there any relevant frameworks available-both for GUI as well as for the object-visualization part?

Thanks a lot!

A: 

1) I would use XMLEncoder (http://download.oracle.com/javase/1.4.2/docs/api/java/beans/XMLEncoder.html)

2) I would try to use something similar to UML (as it is a well understood standard

However, does it have to be in Java GUI? If this was a web-application, then using the XML outputter, you could use some reasonably simple XML Stylesheets (XSL) over the XML to produce the output.

Codemwnci
Thanks for your answer! RE:UML - you mean as display "idea"? But isn't UML more for class diagrams etc rather than single objects, where the values are the main focus?
akapulko2020
It can be a web app I guess - if it can be VERY easily installed (given that I've not much of a backgrounds in this area as well..)
akapulko2020
UML is for Class diagrams, but you can just display the attributes, and their values. If you prefer not to use UML, then a simple tree structure may work as well (this is kind of what you would see in a debug tool to show attribute values).
Codemwnci
A: 

I've used XStream for years and it's performance has been great both in flexibility and speed.

But, if you're going web, then something like Tapestry 5's bean components (BeanDisplay, BeanEditForm and friends) are definitely worth a quick prototype these has been very good friends also.

Pablo Lalloni