Re: [Simple-support] Just started -- some questions
Brought to you by:
niallg
|
From: <Nia...@ub...> - 2008-08-21 08:26:39
|
Hi, I have added my answers under the associated questions. > My compliments -- this is an amazingly well-done and professional > software package. I am considering using it for all my > new code. Great, glad you found it so useful. > I did have a couple of questions which I haven't been able to answer > by reading the archives. > > 1. Have there been any comparisons done between simple and Sun's > XMLEncoder? That's what I was looking at when I came > across simple. > Are there things that XMLEncoder can do that simple can't, and are any > of those things on the roadmap? No, there should be nothing possible with XMLEncoder that simple can not handle. Also simple can handle much more than XMLEncoder can in terms of formatting and flexibility. > 2. Why are @Commit and @Persist and @Complete implemented as > annotations rather than defining a java interface? Because I did not want to intrude in to the developers object model. Consider an existing POJO,you do not always want a public commit method exposed, nor do you always want to add an interface. With annotations you can annotate a private, perhaps existing, method. It will not affect your object model and the user does not even know about it. Just transparent serialization the whole way. > 3. What is the preferred method for selective serialization? What I > want to do is include some elements based on a runtime boolean > expression rather than always serialize them. There are many, there is read resolve and write replace capabilities as you would see in Java Object Serialization. Also the @Persist and @Complete persister callbacks allow you to modify your object prior to serialization and recover it after. Finally the Strategy object is the central point of interception and manipulation in the framework. It will allow you to do just about anything. > 4. Is there any roadmap to providing a hook so you can control the > formatting of the XML output? (Some of my planned applications might > have users looking at the XML files in an editor, and simple doesn't > seem to limit line length.) Also, it might be nice to be > able to > generate comment blocks in the output. Well you have the Format object, this will control indentation. However I have not included line wrapping, which I guess I could include in future. Line wrapping could be done in a custom Writer that just inserts new line characters if its tool long. As for comments, this is something that needs to be added to the OutputNode object, so that you can write comments to a given node. Hope this helps Niall Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. UBS Limited is a company registered in England & Wales under company number 2035362, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS AG (London Branch) is registered as a branch of a foreign company under number BR004507, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. UBS Clearing and Execution Services Limited is a company registered in England & Wales under company number 03123037, whose registered office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom. |