Create_Child and ReadOnlyListBase

Create_Child and ReadOnlyListBase

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


JimStone posted on Thursday, September 18, 2008

What would be the problem with adding exactly the same "empty" Child_Create that is in BusinessListBase to ReadOnlyListBase.

Doing so would allow child lists of both types to be created with excatly the same code in a factory New method.  And increase the consistency of how objects of these types are coded.

Yes, there would be a little added cost over a ReadOnly list just having "Return New ObjectList", but imo the consistency is worth more.

Others thoughts?

 

ajj3085 replied on Thursday, September 18, 2008

Interesting.. when do you Create a readonly list?   I've only ever had a need to Fetch them.

JimStone replied on Thursday, September 18, 2008

Using 3.5.1 Managed properties, the parent item has:

Public ReadOnly Property ChargeInstructions() As CopierChargeInstructionInfoList

Get

If Not FieldManager.FieldExists(ChargeInstructionsProperty) Then

LoadProperty(Of CopierChargeInstructionInfoList)(ChargeInstructionsProperty, CopierChargeInstructionInfoList.Create)

End If

Return GetProperty(Of CopierChargeInstructionInfoList)(ChargeInstructionsProperty)

End Get

End Property

Private Shared ChargeInstructionsProperty As PropertyInfo(Of CopierChargeInstructionInfoList) = _

RegisterProperty(Of CopierChargeInstructionInfoList)(GetType(CopierInfo), New PropertyInfo(Of CopierChargeInstructionInfoList)("ChargeInstructions"))

The Create is in the Get

Copyright (c) Marimer LLC