Skip to content
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

Compositional Classes - multi-class resources #145

Open
joepio opened this issue Jan 2, 2023 · 0 comments
Open

Compositional Classes - multi-class resources #145

joepio opened this issue Jan 2, 2023 · 0 comments

Comments

@joepio
Copy link
Member

joepio commented Jan 2, 2023

The is-a Property in Atomic Data is of the resourceArray URL. This means that any Resource can be an instance of mutiple Classes. However, at this moment, there is not a single Resource that does this.

The reason I opted for mutli-class, is because of the advantages that Composition over Inheritance brings.

Usecases

  • The Property class in Atomic Data is perhaps the most important one of all. It's currently growing by adding properties like is-dynamic and is-locked. That's not necessarily bad, but there is a risk of having a bloated, confusing class. Also, some properties of Property are only relevant to specific datatypes. For example, setting a maxLength is only relevant on strings. Having a classType is only relevant for AtomicURL or ResourceArray types of properties. One solution of dealing with this, is to add new classes for specific datatypes, e.g. PropertyString or PropertyAtomicURL, which then have some properties of their own.

Questions

  • Since the type of additional Property can depend on the values of the instance, it might be possible to infer these (e.g. if we set Datatype in a Property to String, we might need to infer the PropertyString class). Maybe this should be the responsibility of the type system of Atomic? It's probably way too complicated, but it would help in rendering forms that depend on inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant