Hi Frederic,In order to remove the toString method, a patch needs to be made to the code. And then the test suite needs to be run in order to see if there are any side effects. And if there are, rewrite the code that might be using the toString method to use another method.
I'd like to see this resolved. Could you put a bit more energy into the solution?
And please file a JIRA so we don't lose it. Thanks, Craig On Apr 8, 2008, at 12:40 PM, [EMAIL PROTECTED] wrote:
The OpenJPAId used as the key for the cache needs to be able to stringifyin a pretty format.Once the data is in the cache - it is very important to be able to look atthe cache and see what is or is not in there. Becuase the cache is a separate product from the OR mapping - the toString() method is the only thing the cache can use.Abe - I am not sure I understand exactly what your objection was. But ifyour are implying that the toString() method is used to implement somefunctionality (either for kodo or OpenJPA) - then does not that sound to you like you should have used a specific method to implement your specific behavior. I mean the toString() method on a object is there to be able to print (as a string) an object into some kind of pretty format - it is notmeant to be used to implement some specific logic.In organizations using caching products - I really can not see how I couldargue with the IT folks and tell them they can not look into the cache anymore because someone somewhere decided it made sense to overwrite atoString() method. Well... to be fair I could argue it - but I am prettysure I would look foolish.Maybe it is just me - and quite frankly it seems that way since only Craig so far seems to be supporting this request. But I do think that this is a huge deal. The way it is right now this is not production ready. The IT folks will eat me alive if I give them this kind of solutions (and I wouldnot be very proud myself ;) ) Any chance somebody else sees the light here and can puh this proposal further.PS: I am just trying to help, so if folks think this request is not validthen please let me know and I will drop it. I am not proposing a patch becuase there is no code to write - just code to get rid of. Frederic Craig L Russell <[EMAIL PROTECTED]n.COM> To[email protected]Sent by: cc[EMAIL PROTECTED].COM Subject Re: Remove toString from childrenof OpenJPAId - Please - please - 04/07/2008 04:30 please PM Please respond to [EMAIL PROTECTED] e.org Hi Abe, On Apr 7, 2008, at 8:57 AM, Abe White wrote:I believe parts of OpenJPA may rely on being able to stringify an id and then reconstruct it using the id class's Class,string constructor. (And if not OpenJPA, then certainly Kodo's JDO bindings).Right, so the String should be the more detailed String but with the actual subclass name instead of the superclass. So isn't this a bug, for which we would dearly love to see a patch? Craig P.S. As Patrick pointed out, anyone can play with the code via svn and see where the problem is and how to fix it. It might be good to start with a test case and we can discuss whether the behavior currently implemented is correctly designed.On Fri, 2008-04-04 at 17:32 -0700, [EMAIL PROTECTED] wrote:I dont think anyone responded to this request yet - so I am asking again I would like OpenJPA to remove all the toString() method on all children class of OpenJPAId. Reason: OpenJPAId class already has the toString() and it handles it well. It puts the type and the id together - like this: com.myCompany.Account-2345 This is very useful behavior when managing a cache (or even looking into the log file). Currently all the children have their own toString() which just outputs the id - This is not useful becuase it is not possible to distinguish between the types inside one cache. All types in the cache are DataCachePCData. Frederic PS: Can someone give me check in right in the code base... ;) - Have a good week end everyone.Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
Craig L Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
