Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3423 Initial skeleton and poc for the new-REST webapp
  3. DS-3533

(Projection) Provide example code for REST object with optional/lazy-loaded properties

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Accepted / Claimed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 7.0
    • Fix Version/s: None
    • Component/s: REST API v7
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      6
    • Documentation Status:
      Needed

      Description

      See discussion https://gist.github.com/terrywbrady/3ad113963ee88078d25d0623573805be#file-readme-md

      Here is a comment from Andrea Bollini (4Science) on optional properties:

      my idea is to have all the objects ready to hold as much information as possible. This mean that the parent object should be an attribute of our REST objects. We need to define a way to allow lazy loading in a similar way that the Hibernate framework does with the persistent entities.
      We should use annotation to provide to our framework enough information to lazy load the relation when required. This could in turn rely on hibernate lazy-loading capabilities or trough direct invocation of dedicated retrieve methods.

      Request should express interest for optional information specifying a "projection". Both the converter and the repository should be aware of the projection so to

      • lazy load the required information (converter responsibility)
      • optimize the retrieve of the information avoiding lazy load as much as possible

      Projection should be defined as

      • additional information to include
      • information to hide

      where the "base set" for each rest entity is defined. We could introduce an "optional" annotation to define which information are not part of the "base set".

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cwilper Chris Wilper
              Reporter:
              terrywbrady Terrence W Brady
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: