Editable List of ReadOnly Objects?Editable List of ReadOnly Objects?
Old forum URL: forums.lhotka.net/forums/t/2174.aspx
clonger posted on Friday, January 19, 2007
Is there a native CSLA framework class that supports an editable list of ReadOnlyBase objects? From my understanding of it ReadOnlyListBase is an immutable collection of ReadOnlyBase objects and BusinessListBase is a collection of editable BusinessBase objects.
I have searched the forum for an answer to this and aplogize in advance if this has already been addressed or a RTFM question.
Chris
ajj3085 replied on Friday, January 19, 2007
Well, by definition a read only list cannot be modified, nor can a readonly object... so an editable list of readonly objects doesn't make a lot of sense.
clonger replied on Friday, January 19, 2007
ajj3085: Well, by definition a read only list cannot be modified, nor can a readonly object... so an editable list of readonly objects doesn't make a lot of sense.
I apologize if my original post was unclear.
My aim is to have an editable collection that readonly objects can be added and deleted from as well as be persisted to the db. In the application users are given a list of cities (the readonly objects), one or more of which they can select as being of interest. Each users' list (the editable collection) is persisted to the db and when a new story is posted relevant to a city of interest the user receives notification. Users can modify their collection of cities of interest at any time (not just upon the initial creation of the collection).
Brian Criswell replied on Friday, January 19, 2007
I do not think you want an editable list of read-only objects, which would not work using the built-in base classes as you would not be able to save the items in the list. Beyond that, you are really talking about to separate lists: one that the user selects cities from and one of the cities that have been selected. I think you would be looking at the following:
- CityList (read only list of cities)
- City (read only item)
- UserCityList (list of cities the user has chosen)
- UserCity (a city the user has chosen)
So the user has a list of cities that they can choose from, and the ones that they have chosen are persisted to the database.
clonger replied on Friday, January 19, 2007
Brian-
Thank you for the great reply. I think it is right
on.
Chris
___________________________________________
Christopher J.
Long
The Washington Service - Brick Securities
7101 Wisconsin
Avenue
Suite 1410
Bethesda, MD 20814
Office: (301)913-5122
Fax:
(301)913-5101
Bloomberg: WSA <GO>
Mobile: (301)602-2590
I do not think you want an editable list of read-only objects, which
would not work using the built-in base classes as you would not be able to save
the items in the list. Beyond that, you are really talking about to
separate lists: one that the user selects cities from and one of the cities that
have been selected. I think you would be looking at the following:
- CityList (read only list of cities)
- City (read only item)
- UserCityList (list of cities the user has chosen)
- UserCity (a city the user has chosen)
So the user has a list of
cities that they can choose from, and the ones that they have chosen are
persisted to the database.
Copyright (c) Marimer LLC