CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

RootObject with Editable ChildList containing Read-Only Child Objects ?

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 1 Reply | 1 Follower

Top 500 Contributor
23 Posts
Alexander Becker posted on Wed, Apr 18 2012 5:05 AM

Hello,

please assume you have users and group.
Each user can be a member of many groups.

The UI should display the users details and a list of referenced groups.
Additionally it has to be possible to remove selected groups,
and to add a group selected by a separate combo-box containing available groups.

My idea was to create the following stereotypes
 - UserEdit as EditableRoot Object
 - GroupList as Editable Child List
 - GroupInfo as Read-Only Child Object

Unfortunately it seems that an EditableChildList cannot contain Read-Only Child objects.
What do I miss here?
Why has the Group object to be an editable object? I only want to display informations of it.
Only the referencing list has to be modified, but not the containing elements.

Thanks in advance,
Alexander

 

All Replies

Top 10 Contributor
1,815 Posts
Suggested by JonnyBee

An editable list will only accept editable objects that implements:

ISupportUndoIUndoableObjectITrackStatus

IE: Can participate in N-Level undo and keeps track of whether they are dirty or not.

ReadOnly objects do NOT implement these interfaces and cannot be used in an editable list.

You do NOT only want to display information - you must also know whether item status is IsDeleted, IsNew og none (existing).

And the list has an "owning" reference to all it's child objects - so they CANNOT be owned by multiple lists in order to participate in N-Level undo.

Jonny Bekkum, Norway CslaContrib Coordinator

Page 1 of 1 (2 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems