I have a use case where the user needs to call up an existing order and work with items it contains. So I have
Order : ReadOnlyBusinessBase
OrderDefects : EditableRootListBase (DynamicList?)
Defect : BusinessBase (DynamicRoot?)
Are there any framework rules I'm gonna break here? It seems correct-ish. The factors I need to keep in mind is that the Order cannot be modified in any way, Order is used to create new defects for the ERLB objects, Order must be read only. Order's collections should be manageable from within the UI I imagine, but haven't written this type of hybrid yet.
Thanks,
_E
One of the issues you will be dealing with is the fact that ReadOnlyBusinessBase does
not have IsDirty, IsValid, etc…
Just a thought, but I would consider changing your root object
to Business Base with all properties being read-only.
Sergey Barskiy
Senior Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Magenic ®
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: esteban404
[mailto:cslanet@lhotka.net]
Sent: Wednesday, April 30, 2008 10:20 AM
To: Sergey Barskiy
Subject: [CSLA .NET] RO base containing ERLB
I have a use case where the user needs to call up an existing order and work
with items it contains. So I have
Order : ReadOnlyBusinessBase
OrderDefects : EditableRootListBase (DynamicList?)
Defect : BusinessBase
(DynamicRoot?)
Are there any framework rules I'm gonna break here? It seems correct-ish.
The factors I need to keep in mind is that the Order cannot be modified in
any way, it's used to create new defects for the ERLB objects, Order must
be read only. Order's collections should be manageable from within the UI I
imagine, but haven't written this type of hybrid yet.
Thanks,
_E
Thanks, Sergey,
I thought that the ERLB collection would auto save the items as the grid is edited/navigated, so there'd be no reason to use the IsDirty or IsValid at the root order level, but at the ERLB item level there would be as part of the auto save. The users will need immediate action on the data, so it should never be in an in-between state that I'd need to check for these. Hmm. I'll have review deeper and be careful.
Good thought for thoroughness, thanks!
BTW, I'm using CSLA 3.0.4 for this.
_E
I re-read the requirements and changes in the 2.1 e-book. Since the IParent interface is utilized by ERLB, it may not work correctly with a ROB object. I created a new object inheriting from BB to hold the ERLB collection of defects, but the methods for insert, update, delete, and deleteself don't apply to the root object as nothing can be modified and the fields only have get accessors.
Since nothing can change would this big honkin container of Order need to implement an Update so it can fire the ERLB object code? Seemed like that was being done by the ERLB base item object.
I'll write a test fixture to see how it moves through it all. Any more opinions about this are welcome, of course. I think this project will have more of these due to the nature of the client's business flow.
Cheers,
_E
Copyright (c) Marimer LLC