does businessbase gets collection of items

does businessbase gets collection of items

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


yh_ink posted on Friday, June 16, 2006

I am new to CSLA.I would like to know if we can do a collection or list of items from database in the businessbase instead of  businesscollection base.

Thanks

Michael Hildner replied on Friday, June 16, 2006

Hello yh_ink,

I hope I understand you correctly. It sounds like you want a single root object that contains a collection of child objects. If so, yes. An example would be the Project class in the ProjectTracker sample application.

Let me know if I misunderstood.

Mike

yh_ink replied on Friday, June 16, 2006

hey michel,

 i need single root object which contains the collection.i dont want any child objects....Where can i get a good example of the collection with in root.And would you please let me know about the sites related to csla framework.

please let me know about this...

thanks

Michael Hildner replied on Friday, June 16, 2006

>>i need single root object which contains the collection.i dont want any child objects

I guess I don't understand. You need a root object that contains a collection, I assume you mean a collection of business objects. Is that right? Maybe if you could explain what you need to at a higher level I'd get the picture.

As far as sites for CSLA, check out the "Other resources" link at the top of the page.

Do you have the CSLA book?

Regards,

Mike

yh_ink replied on Saturday, June 17, 2006

Hey Michael,

Let me be clear in what i am trying to do.I have a web form where there is a list box.I got to get the contents of the  list box.So the list box will have more data.My question is can i do that just having a businessbase alone.

I know that if i have a businesscollectionbase we can do that.But in csla can we get the collection of data be displayed just using businessbse instead of having both businessbase & businesscollectionbase.(as collection would require businessbase tooo root object) 

yep i have the book,

thanks

please let me know if u understand my question

Michael Hildner replied on Saturday, June 17, 2006

yh_ink,

I think I understand now. I'm no expert at CSLA, maybe someone else will chime in and confirm, but I think you'll need two classes. Since you'll have a collection of objects in your list box, I think you might want to have an Editable Root Collection (BusinessListBase) which holds a collection of Editable Child (BusinessBase) objects.

That's of course if you need them to be editable, otherwise it would be read only.

Mike

RockfordLhotka replied on Sunday, June 18, 2006

If this is just to populate a list box, you should use a ReadOnlyListBase-derived root object, which would contain ReadOnlyBase-derived child objects for each "row" of data.

Alternately, you might consider using the NameValueListBase, because it is specifically designed to simplify the process of getting data to load combo box and list box controls.

yh_ink replied on Sunday, June 18, 2006

so using NameValueListBase i can fill the listbox  with values by calling the database table.Is that a better way of doing.

Or can i have businessCollectionBase and BusinessBase instead.

thanks

RockfordLhotka replied on Sunday, June 18, 2006

Read chapters 6 and 7, they should help quite a lot in explaining the purpose behind each of the base classes.

Copyright (c) Marimer LLC