I to implement a Collection?

I to implement a Collection?

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


elnoegarcia posted on Friday, August 31, 2007

Hi!!

Well, in spite of the fact that I've read a couple of books over of the topic of CSLA, I've never really made any application with it until now (well, I try!!).

But I'm undecided about a property that I'm trying to implement with a collection; this property is really a list of phone numbers (think about they're of a customer of any store). The class name is Phone, which only has two properties PhoneType (home, work, movile, etc.) and Number, and I decided to save that property (that phone numbers) in only one field of a Table in my Database; I thought to concatenate all the phone numbers with separators (a Comma or a Tab for example), but what really has me woorried is ¿how to declare that property? ¿as a CSLA EditableChildList(Of Phone) or just a List(Of Phone)? ¿How can I validate that property? thinking in that the record which has the numbers comes in the same record and from the same table as well as all other properties of a single "Customer" (not as is in the project tracker sample project).

If anyone has any idea that can help me....I will appreciate it a lot!!
Best regards to everybody!
Noé

Marjon1 replied on Friday, August 31, 2007

Noé,

The way that the information is saved or retrieved from the database, is really idependent of the type of collection that you would use. As the Phone object itself, will be responsible for creating itself from the data passed to it, and that shouldn't change between the List(Of Phone) or EditableChildList(Of Phone). If you are saving it in the same table as the customer object or not is really not the collection's problem.

The primary benefits that I can see (and anyone please feel free to correct me) to using a EditableChildList over List:


That is just my AUD$0.02

Copyright (c) Marimer LLC