pulibrary / figgy

Valkyrie-based digital repository backend.
Other
35 stars 4 forks source link

Distinguish between different kinds of resources #3547

Open hackartisan opened 4 years ago

hackartisan commented 4 years ago

There are really a lot of objects which subclass Resource or Valkyrie::Resource. Nested resources are pretty well distinguished because they have their own directory. Otherwise, some resources may just be for internal or transitory use (e.g. IngestableFile and Term), some may be only system-managed, and others may be what I'd call "first-class" resources (e.g. ScannedResource, EphemeraFolder), with forms and show pages.

When adding functionality to all or some subset of resources it would be really helpful to have these categories clearly defined and applied, either in code organization or inheritance hierarchy.

Corollary: do we want to refactor objects which are never actually persisted out of resources and into POROs or some other kind of object? What are we getting by making some of these objects resources?

tpendragon commented 4 years ago

Work that needs to be done:

Talk about the resource types and see if there are any we can re-organize into their own place and document why in an ADR.

kelea99 commented 1 year ago

@hackartisan any way I can help with this?

hackartisan commented 1 year ago

categories of resources:

Questions:

hackartisan commented 1 year ago

It seems like schemas, change sets, and decorators ought to be more aligned, and more parallel in their organization.

Note that change set has a concept of a core resource: https://github.com/pulibrary/figgy/blob/5e0a9321a637de4e7ffbb4b1bd8a59d9efe01d66/app/change_sets/change_set.rb#L39

hackartisan commented 1 year ago

A goal of working this ticket would be to make tasks like "Do X to all resources" easier to perform. Here are some example tickets for that kind of task: