开发者

How should I implement an "object viewer/visualizer"?

开发者 https://www.devze.com 2023-01-16 18:25 出处:网络
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.

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 s开发者_如何学运维erialized 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!


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号