The following issue has been updated:

    Updater: Tyler Ward (mailto:[EMAIL PROTECTED])
       Date: Thu, 24 Mar 2005 1:12 PM
    Comment:

This is the new value object template. I didn't diff it into a patch, as it is 
so severely different. 
    Changes:
             Attachment changed to valueobject.xdt
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1313?page=history

---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1313

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-1313
    Summary: Fixed value object template to make more useful code
       Type: Improvement

     Status: Open
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XDoclet
 Components: 
             EJB Module
   Versions:
             1.2.2

   Assignee: xdoclet-devel (Use for new issues)
   Reporter: Tyler Ward

    Created: Thu, 24 Mar 2005 1:11 PM
    Updated: Thu, 24 Mar 2005 1:12 PM
Environment: any.

Description:

I updated the value objects to fix a lot of issues and weaknesses in the old 
code. Here is roughly what I did. 

1) Added a new method that returns an unmodifiable collection (or set) for the 
relationships. get*Collection(). This prevents the users from needing to 
produce an array every time they want to use the values of that relationship. I 
did not remove the array based methods, for compatibility, but perhaps they are 
not needed.

2) Changed the getAdded*s(), etc... methods to return unmodifiable collections, 
outsiders shouldn't be adjusting those sets. We might also want to remove the 
setAdded*s(Set|Collection) methods, as once again, outsiders shouldn't be 
adjusting those.=20

3) Added three "synchronization" options.=20
   a) "None": Nothing is synchronized.
   b) "Partial": Collections become 
Collections.synchronized[Collection|Set](...). This is needed because the 
unmodifiable collections can easily end up in different threads, and are not 
likely to be consistent when viewed from other threads if the underlying 
collection is not synchronized.
   c) "Full": All collections are synchronized. All methods are synchronized.


The default is "Partial". In most cases, even the "full" option should not 
allow for deadlock unless the .hashCode(), .equals() or .compareTo() methods of 
the inner objects acquire contended locks during the course of normal 
operation. This would allow a deadlock in a synchronized collection. I plan to 
use "full" for my project (unless a compelling performance problem is 
encountered) for safety. I would be willing to make the default "none", but 
that seems unnecessarily dangerous, and for very little gain.

4) Add two "ordering" options.=20
    a) "Strict": The object extends comparable. Primary key equality determines 
object equality/hashCode/Comparison. Primary key fields must be comparable.
    b) "Permissive": The objects are compared on all fields. Values do not 
extend Comparable (basically, how it was before).

The default is "Permissive".

5) Value objects now correctly implement Cloneable.
6) Value objects now also have a read-only wrapper inner class that can be 
returned. It includes all the getters, but none of the setters. I'm thinking of 
having it be comparable if the Value object is comparable, cloneable (which 
will just make another wrapper around the same Value object), and overriding 
.equals and .hashCode for it. As well as making it serializable.

Let me know if these changes seem reasonable. 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to