Skip to content

Establish read/write WritableTopic? #113

Description

@JeremyCaney

Currently, the Topic entity has a lot of extraneous plumbing and complexity that's needed exclusively for the potential that topics are going to be created, modified, or deleted. But that's only true on e.g., the OnTopic Editor, and any Topic-targeting forms that implementors establish. In the vast majority of cases, topics will be read-only. Given this, we could dramatically simplify Topic to just be read-only, then move all of that extra plumbing to a new WritableTopic.

Considerations

This option needs to be fleshed out, but some initial notes:

  • This may not make sense as a derived type of Topic; it may make more sense as a wrapper
  • In addition to obvious members like IsDirty() and MarkClean(), this could simplify other related members:
    • We could remove DerivedType, and bake in the inheritance when the topic hierarchy is being established
    • VersionHistory could not only be removed, but could also be skipped as part of the LoadTopics stored procedure for read-only versions
    • This could use a simplified ReadOnlyCollection derivative for Attributes
      • The AttributesCollection and underlying TrackedRecordCollection<> include a lot of write plumbing!
        • E.g., _topicPropertyDispatcher, DeletedItems, IsDirty(), AllowClean(), MarkClean(), ClearItems(), and SetValue()
        • E.g., all of the overrides like InsertItem(), SetItem(), and RemoveItem()
      • The AttributesCollection would likely still need to be supported on the WritableTopic, potentially inheriting from the new read-only collection
  • We should determine how much practical overhead the writable plumbing actually introduces in a day-to-day capacity
    • This may be pretty trivial, outside of cluttering and complicating the public interface

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: EntityRelates to the core data data structure for modeling topic entities.Priority: 2Severity 2: MajorStatus 0: DiscussionNeeds further evaluation of requirements and prioritization.Type: FeatureIntroduces a major area of functionality.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions