atomic-data-docs icon indicating copy to clipboard operation
atomic-data-docs copied to clipboard

Multi-class Resources

Open joepio opened this issue 4 years ago • 0 comments

Currently, Atomic Data sets classes for a Resource using the is-a Property. This supports multiple values, which means that Resources can be instances of multiple classes. Classes are mainly used for:

  • Rendering forms (because a class could tell something about required and recommended properties)
  • Selecting the best View for a resource (the front-end allows Views to register for some specific Class)
  • Validating resources (similar to forms, by using required / recommended properties)

However, I'm having some doubts on supporting a multi-class model. In other words, I'm considering using an AtomicURL instead of a ResourceArray for the datatype of the isA property. Let's use this issue to consider the merits / downsides of having multi-class support.

Using a single URL for an instance that is many things

Imagine wanting to describe Jay-Z. He's a person, so you might want to show properies like his first name, gender, birthplace, etc. However, he's also a musical act, with its own discography, labels and genres properties. We might say Jay-Z is just one Subject, with one URL, which has two classes: Human and MusicAct. That is the multi-class approach.

A different approach, is to have a URL for Jay-Z the person, and a separate URL for Jay-Z the music act.

Increased complexity in views and forms

Having multiple classes makes things harder. For example, implementing a Form that combines all the Required / Recommended properties.. Also, when rendering a View for a resource, things become more complicated if there are multiple Views available - Imagine rendering something that's both a Calendar item and a Person - which view do you want?

joepio avatar May 30 '21 11:05 joepio