-
Notifications
You must be signed in to change notification settings - Fork 18
docs: ADRs for modeling containers capability #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
2906792
b1b1a88
413b66c
0deab25
22eb1ae
db61fda
b5f05d8
9d2c62d
8648f16
80cf370
b98c02c
ccada60
778ce2b
e738778
3a28fa5
bbce789
af7dce4
506d9cd
466b450
46999f8
0c426d2
46dfa9e
d37a414
64e4db9
46e5a09
822d9a0
8646225
1f1c962
f260756
86141e5
aff8b9b
76e89d5
6ecde96
f7cc446
dc5a0a2
d0f1fc8
83f8d04
8fa418e
6fd6864
901c560
bb7c526
20688f1
7046bec
76fa742
7b18cb4
6152dba
2e945d0
728c1e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||||||||||
| 17. Modeling Containers as a Generalized Capability for Holding Content | ||||||||||||||
| ======================================================================== | ||||||||||||||
|
|
||||||||||||||
| Context | ||||||||||||||
| ------- | ||||||||||||||
|
|
||||||||||||||
| This ADR proposes a model for containers that can hold different types of content, including custom content types, and that can be used to create courses. The model defines the core structure and purpose of containers, the types of containers and content constraints, the members and relationships of containers, version control, publishing, and pruning. | ||||||||||||||
|
|
||||||||||||||
| Decisions | ||||||||||||||
| --------- | ||||||||||||||
|
|
||||||||||||||
| 1. Core Structure and Purpose of Containers | ||||||||||||||
| =========================================== | ||||||||||||||
|
|
||||||||||||||
| - A container is designed as a generalized capability to hold different types of content. | ||||||||||||||
| - A container is a publishable content type that holds other content types through a parent-child relationship. | ||||||||||||||
| - A container application will offer shared definitions for use by other container types. | ||||||||||||||
|
||||||||||||||
|
|
||||||||||||||
| 2. Container Types and Content Constraints | ||||||||||||||
| ========================================== | ||||||||||||||
|
|
||||||||||||||
| - A container marks any PublishableEntity, such as sections, subsections, units, or any other custom content type, as a type that can hold other content. | ||||||||||||||
| - Containers can be nested within other containers, allowing for complex content structures. | ||||||||||||||
| - Containers might be of different types, with each type potentially having different restrictions on the type of content it can hold but that will not be enforced by containers. | ||||||||||||||
| - Content restrictions for containers are implemented at the app layer, allowing specific container types, like Unit, to limit their members to particular content types (e.g., only Components). | ||||||||||||||
| - The course hierarchy Course > Section > Subsection > Unit will be implemented as relationships between containers, with each level acting as a container that holds other content. The hierarchy will be enforced by the content restrictions of each particular container but allowed to be overridden to support `0002-content-flexibility.rst`_. | ||||||||||||||
| - Containers will follow extensibility principles in `0003-content-extensibility.rst`_ for creating new container types or subtypes. | ||||||||||||||
|
|
||||||||||||||
| 3. Container Members and Relationships | ||||||||||||||
| ======================================= | ||||||||||||||
|
|
||||||||||||||
| - The members of a container can be any type of publishable content. | ||||||||||||||
| - Members within a container are maintained in a specific order as an ordered list. | ||||||||||||||
| - Containers represent their content hierarchy through a structure that defines parent-child relationships between the container and its members. | ||||||||||||||
| - The structure defining these relationships is anonymous, so it can only be referenced through the container. | ||||||||||||||
mariajgrimaldi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||
| - Containers can hold both static and dynamically generated content, including user-specific variations. | ||||||||||||||
|
||||||||||||||
| - Each container holds different states of its members (user-defined, initial, and frozen final state) to support rollback operations. | ||||||||||||||
|
||||||||||||||
| - Members can be added or removed from a container, and the container will maintain the state of the content for the previous version (frozen final state). | ||||||||||||||
| - The initial state of a container is immutable. | ||||||||||||||
|
||||||||||||||
| - Each container holds different states of its members (user-defined, initial, and frozen final state) to support rollback operations. | |
| - Members can be added or removed from a container, and the container will maintain the state of the content for the previous version (frozen final state). | |
| - The initial state of a container is immutable. | |
| - Each container holds different states of its members (user-defined, initial, and frozen final state) to support rollback operations. | |
| - The initial state of a container is immutable. | |
| - Members can be added or removed from a container, and the container will maintain the state of the content for the previous version (frozen final state). |
I was confused what "the initial state is immutable" meant until I realized that "initial state" is one of three "states" mentioned earlier, and doesn't mean "the first version of a container"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, it mentions the initial list of members instead of "state".
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a difference between specifying "latest draft" and specifying "latest published" or is there just a way to say "latest" (version=None), and whether that is draft or published depends on _______ ?
EDIT: OK, from looking at the code it appears that each container (via EntityListRow) can specify both a draft_version and a published_version at the same time, separately. And each can be either pinned or unpinned. I guess I'm very unclear on how this works when the ContainerEntityVersion itself is versioned and has a draft + published version.
If I have a draft ContainerEntityVersion, what do its EntityListRows' published_versions mean? And when I publish it, so it's now a published ContainerEntityVersion, what do its EntityListRows' draft_versions mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I have a draft
ContainerEntityVersion, what do itsEntityListRows'published_versions mean? And when I publish it, so it's now a publishedContainerEntityVersion, what do itsEntityListRows'draft_versions mean?
I originally had it with just version, but I vaguely remember thinking that I had to add draft_version separately from published_version to address some edge case... which I have totally forgotten the specifics of. And maybe was wrong-headed to begin with. 😛 Let's take it back out for now and just keep version–if said weird edge case was real, I'm sure we'll run into it in the not-too-distant future, and deal with it then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ormsbee: during our latest discussion, you mentioned that having both, mainly the draft version, covered the CCX use cases where we don't necessarily control the latest draft version, so we'd want to pin it for the author's context. Do you think we should cover that case later on?
We also discussed that having both would help us know which published/draft versions were in the frozen list when creating the next version, but I think that the use case could be covered by having a single reference to the current version draft or published. Would you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ormsbee: during our latest discussion, you mentioned that having both, mainly the draft version, covered the CCX use cases where we don't necessarily control the latest draft version, so we'd want to pin it for the author's context. Do you think we should cover that case later on?
I think I was mistaken there, because if the author wanted to pin to a specific version, they could do so, and then when they decided to undo that pin to get something later, they could do so with a new version of the container–no need to keep the publish versioned separate.
We also discussed that having both would help us know which published/draft versions were in the frozen list when creating the next version, but I think that the use case could be covered by having a single reference to the current version draft or published. Would you agree?
Yeah, I agree.
I think where my head might have been going is what happens in the following scenario:
- UnitVersion UV1 has an unpinned reference to Component C1.
- C1 has ComponentVersions CV1 and CV2. CV1 is the current published version, while CV2 is the draft version.
- C1 is soft-deleted, forcing UV1 to pin down its references to the last version. But does it pin to CV1 or CV2?
So I'm still kicking it around in my head, but I'm trying to see how things line up with Unit/Container modeling if we don't force new container versions to be created when things get deleted, and instead filter out the deleted stuff at read time. I think it could get rid of a lot of the bookkeeping needs for the model. I'm trying to sketch this out this evening to see if it fits together in a reasonable way...
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you "pin" to a specific draft version or published version? I would assume you can only pin to a specific version number, which isn't really considered "draft" or "published" - it's just a specific version (that may have been the latest published version and/or latest draft version at some point, but may or may not be now).
e.g.
1 2 3 4 5 6 7 8
^ ^ ^
| | v8 is draft
| v5 is published
Pinned to v3
In this scenario, v3 is just a specific version, neither published nor draft.
Edit: OK, I see now you can pin "draft" and "published" separately for each EntityRow, but I'm confused on the implications of that.
mariajgrimaldi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
mariajgrimaldi marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
What I'm still missing here is the behavior of publishing containers when they're being reused somewhere and modified in some way. I understand we discussed this in our last meeting, but it's still not clear to me what our approach should be from the modeling point of view.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these decisions be part of this ADR as well?
- All members within the container should be published before the container can be reused.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| 18. Modeling Units as a Concrete Implementation of the Container Capability | ||
mariajgrimaldi marked this conversation as resolved.
Show resolved
Hide resolved
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this requires its own ADR, but it helps illustrate the decisions using a more familiar concept like units. |
||
| ======================================================================= | ||
|
|
||
| Context | ||
| ------- | ||
|
|
||
| The container capability is a generalized capability to hold different types of content. This decision focuses on modeling units as a concrete implementation of the container capability. | ||
|
|
||
| Decisions | ||
| --------- | ||
|
|
||
| All decisions from `0017-generalized-containers.rst`_ are still valid so that this decisions will build on top of them. | ||
|
|
||
| .. _`0017-generalized-containers.rst`: 0017-generalized-containers.rst | ||
|
|
||
| 1. Units as Containers | ||
| ======================= | ||
|
|
||
| - A unit is a concrete type of container that holds components. | ||
| - A unit is a container, making it also a publishable entity. | ||
| - A unit application will offer shared definitions for use by other unit subtypes. | ||
|
||
|
|
||
| 1. Unit Types and Content Constraints | ||
| ====================================== | ||
|
|
||
| - Units can only hold components as their members but will not enforce this restriction at the model level. | ||
| - Content restrictions for units are implemented at the app layer, allowing units to limit their members to components. | ||
|
|
||
| 1. Unit Members and Relationships | ||
| ================================== | ||
|
|
||
| - The members of a unit can only be components. | ||
|
||
|
|
||
| 4. Unit Versioning Management | ||
| ============================== | ||
|
|
||
| - A unit is versioned, and a new version is created if and only if the unit itself changes (e.g., title, ordering of contents, adding or removing content) and not when its content changes (e.g., a component in a unit is updated with new text). | ||
Uh oh!
There was an error while loading. Please reload this page.