Changes between Version 10 and Version 11 of PRO_LIB_UTILS_R0


Ignore:
Timestamp:
12/10/08 13:54:42 (17 years ago)
Author:
orliin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PRO_LIB_UTILS_R0

    v10 v11  
    2525 
    2626= Design = 
    27  * Assign 
     27 * Assign - public static <T extends !ProObject> void assign(T dest, T source) 
     28The assign() method should copy the values of all properties of the source !ProObject to the destionation !ProObject. It should be a "smart" copy, so for each property should be decided how to be copied. 
     29 
     30Implementation can just call a private assign() method that works for a particular property and can decide how to copy it. 
     31 
     32 * Clone - public static <T extends !ProObject> T clone(T src) 
     33The clone() method should make a new !ProObject instance which is a copy of the original object. The properties in the new instance have their values assigned from the original object. 
     34 
     35Implementation can just make a new !ProObject instance and then call the assign() method to copy all property values from the original to the new instance. 
     36 
     37 * Single property assign - private static <T extends !ProObject> void assign(!ProObject dest, !ProObject source, String propId) 
    2838The assign() method should take care about property types and annotations to decide what to do when trying to copy data. Here are all the cases: 
    2939||property types||relation/annotation||value class||value action||comment|| 
     
    4656||!AutoListProperty ||   --> ||  -->     ||none      ||do nothing|| 
    4757 
    48 Implementation should just add these cases to the assign() method in the !ProUtil class. 
    49  
    50  * Cloning 
    51 The clone() method should make a new !ProObject instance which is a copy of the original object. The properties in the new instance are assigned their values via the assign() method. 
     58 * New annotation - @Shared 
     59A new annotation should be created. This annotation is for the smart copying of objects. If a property is marked as @Shared, this means that the value it holds should be the same for all objects using this property. In other words, when copying such property the new property should hold a reference to the value, not a clone of the value. 
    5260 
    5361 * Tests 
    54 org.sophie2.core.prolib.util.ProUtilTest.java 
     62org.sophie2.core.prolib.util.!ProUtilTest 
    5563 
    5664= Implementation =