Implement BusinessDocumentBase combining BusinessBase and BusinessListBase#4815
Implement BusinessDocumentBase combining BusinessBase and BusinessListBase#4815rockfordlhotka wants to merge 2 commits intomainfrom
Conversation
Document the design for a new class that combines BusinessBase and BusinessListBase capabilities using composition. This enables the "Document Pattern" where a business object has its own properties AND contains a collection of child items. The plan includes: - Complete interface analysis from both base classes - Conflict resolution strategies for shared interfaces - 10-phase implementation plan with specific tasks - Risk assessment and success criteria Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
I looked for a related discussion or issue for this PR, but didn't find one. What is the intended utility for this kind of class? Looking at this initial plan, I wonder how more complex documents would be handled. By more complex, I mean having multiple child lists. In the invoice example, the editable Invoice class in my project would also have a comments collection, a contacts collection. Thinking across the full project, I don't have any documents with only a single collection. |
|
You are describing a business (base) object. I think the purpose of this PR is to get the whole rules stuff etc. into a business list class. |
|
I get that use case. Those business rules currently have to be handled in the parent class. We typically use properties on the child classes to indicate their error state. For example, the child will have an IsDuplicate property with a rule that ensures the property is false. I'm all for simplifying this scenario, but it wasn't clear in the description and the generated plan. Sorry for butting in without understanding the full context. |
|
…BusinessListBase Adds BusinessDocumentBase<T,C>, a new base class that inherits from BusinessBase<T> and adds full BusinessListBase<T,C> collection capabilities. This enables the "document pattern" where a single business object has its own managed properties, validation rules, and authorization AND contains a collection of child items. Key features: - Full IList<C> collection support via composition (MobileList<C>) - Deleted child tracking (IContainsDeletedList) - N-level undo cascading to collection children - IsDirty/IsValid/IsBusy aggregation across properties and children - MobileFormatter serialization of collection items - CollectionChanged/PropertyChanged events - LoadListMode for bulk loading without events - Child data access (Child_Update/Child_UpdateAsync) Includes IBusinessDocumentBase<C> interface and 29 unit tests covering create/fetch, collection operations, status aggregation, events, clone, and n-level undo. Implements #1830 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
BusinessDocumentBase<T,C>, a new base class that inherits fromBusinessBase<T>and adds fullBusinessListBase<T,C>collection capabilitiesIBusinessDocumentBase<C>consolidated interfaceKey Features
IList<C>collection support via composition (MobileList<C>)IContainsDeletedList)IsDirty/IsValid/IsBusyaggregation across properties and childrenMobileFormatterserialization of collection itemsCollectionChanged/PropertyChangedeventsLoadListModefor bulk loading without eventsChild_Update/Child_UpdateAsync)RegisterProperty/RegisterMethodwith correct type resolutionTest plan
Closes #1830
🤖 Generated with Claude Code