Duplicate (unused) storage with managed property + backing field?

Duplicate (unused) storage with managed property + backing field?

Old forum URL: forums.lhotka.net/forums/t/5971.aspx


rsbaker0 posted on Wednesday, December 10, 2008

I've been investigating additional use for managed properties and was considering changing all my generated DTO-type BO's to use a managed property with private backing field (for load performance).

However, it appears to me that the FieldDataManager for such an object will allocate an IFieldData slot in the (in _fieldData) for each such property -- even though I don't plan to use it -- if  I include any completely managed properties in the same object.

My concern is that, for example, I might have previously had an object whose field members included 50 or so value types, and now I've added an empty array of 50 null IFieldData references, which could be more than double the size in some cases.

Another minor concern is that I could mix calls -- those that specify the backing field and those that don't, and the framework wouldn't catch this. I'd almost suggest that a different type of PropertyInfo should be used with private backing fields.

Is my interpretation of this correct? And if so, should I just not worry about the size issue (e.g. the empty IFieldData slots wouldn't be serialized, etc.)?

Copyright (c) Marimer LLC