wiki:PRO_LIB_UTILS_R0

Version 9 (modified by orliin, 17 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Analysis

Overview

Property Utilities are additions to the Properties Library that provide extra functionality.

Task requirements

Add utilites that:

  • Assign values to a property (except Auto Properties)
  • Clone objects with properties
  • Other - discuss with the team if something else is needed at this iteration

Task result

The task result should be source code (with unit tests included).

Implementation idea

Cloning should keep only those properties that are needed.

PRO_LIB_CORE_TUTORIAL

How to demo

Present the utilities to the team and run unit tests to demonstrate them.

Design

  • Assign

The 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:

property typesrelation/annotationvalue classvalue actioncomment
ValueProperty @own immutable error
pro-obj pro.clone
else error
@sharedall copy ref
none immutable copy ref This includes FinalProperty obects
else error
ParentProperty all set null Better decide whether to keep the same parent in each case.
FinalProperty --> --> --> Same as ValueProperty. Should the assign operation be possible? Probably not because it should be immutable
ResourceProperty --> --> none do nothing
AutoProperty --> --> none do nothing
ValueListProperty --> --> --> Create a new list and apply the rules for ValueProperty to the elements of the list as if they are single values
AutoListProperty --> --> none do nothing

Implementation should just add these cases to the assign() method in the ProUtil class.

  • Cloning

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.

  • Tests

There is a unit test which is in the ProUtil package

Implementation

(Implementation results should be described and linked here (from the wiki or the repository)

Testing

Comments

Log

Error: Macro Include(wiki:PRO_LIB_UTILS_R0_LOG) failed
current transaction is aborted, commands ignored until end of transaction block