openedx-unsupported / blockstore

Open edX Learning Object Repository
GNU Affero General Public License v3.0
15 stars 20 forks source link

Nuances of the bundle format #48

Closed bradenmacdonald closed 5 years ago

bradenmacdonald commented 5 years ago

Warning: brain dump.

At this time, the evolution of the bundle format used for content libraries in blockstore-relay and my draft runtime PR is described in this docstring.

One aspect of this design that has proven a bit more complex than I hoped is the following:

        Any OLX file that represents an XBlock type that can have children may
        contain <xblock-include> nodes, like this:
            <unit>
                <xblock-include definition="html/intro" />
                <xblock-include definition="html/intro" usage="alernate" />
                <xblock-include definition="linked_bundle/html/intro" usage="linked_intro" />
            </unit>
...
        Any block which exists in the main bundle (not linked in to the bundle)
        and which is not a child of other blocks (no <xblock-include /> nodes
        reference it) is called a "top-level block". Its usage ID always matches
        its definition ID.

Another way of phrasing the existing design is:

This design has these nice properties:

But it has these problems:

So although those may not be big problems, they don't feel like a particularly elegant or clean design. I would be open to better ideas before anything gets too entrenched.

Some ideas I considered but discarded:

SSPJ commented 5 years ago

A quick thought: you talk about the need to cache results of computing top level blocks. If this computation is cached by means of a flag in the block itself, it can become "sticky", i.e. once a block is found to be a top level block, it remains so thereafter until a user explicitly removes the flag.

In that way, a block stays in the library even if it is later added as a child to other blocks.

symbolist commented 5 years ago

@bradenmacdonald @ormsbee

A couple of questions:

  1. I understand in general most blocks that are children of others in a library may not be for re-use but which blocks are for re-use seems to me to be orthogonal to where they are in the block graph in the bundle? The problems noted above are because of complecting the two?
  2. To take this one step further should re-usability status of blocks in a library even be declared in or derived from the definition of blocks?
bradenmacdonald commented 5 years ago

I guess I was assuming that in general, blocks designed for re-use should be put at the top of the bundle/library. Though it's certainly possible to re-use child blocks.

Do you think we need a separate mechanism for flagging blocks as "suitable for re-use"?

symbolist commented 5 years ago

@bradenmacdonald

Do you think we need a separate mechanism for flagging blocks as "suitable for re-use"?

That certainly is more flexible but whether we need that flexibility or can work around it depends on product requirements. I don't think any users will be using the library 2 interface in Studio immediately so maybe we come back to this later?

bradenmacdonald commented 5 years ago

Closing as this should be resolved by #53.