From: Anton v. S. <an...@ap...> - 2002-10-02 04:45:48
|
> On the other hand, > > sessionFactory.openDatabinder().toXML(foo); > > does a really nice job of printing an object..... I haven't tried that, but I will, thanks. This made me think some more... Ideally, having a single method with fixed behavior for something like this, on a class like Hibernate or Session, may not be such a good idea. It would be better if the behavior were customizable or pluggable, and perhaps that would lead to a different interface style anyway. Perhaps the code to do this could be packaged as a class which a developer could use to implement their own final result, i.e. provide methods that allow the components of an object's string representation to be arranged differently, abbreviated, or whatever. This could have the additional benefit of not needing to extend any existing classes or interfaces, and being more orthogonal to the core Hibernate persistence functionality. Anton |