Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-3705

[Perf] Introduce a TitleCachingService SPI

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Done
    • 2.0.0
    • 2.1.0, 3.1.0
    • Core
    • None

    Description

      Calculating titles can cause pages to render much slower than they otherwise would, because any object with a reference to others (especially in a collection) requires the title to be evaluated for those references, and this often will require that entity to be fetched in order to access its properties that make up its title.  In the worst case, that referenced object's title might use not only scalar properties, but also other referenced information, so a whole cascade of queries might kick off.

      One option to address this is for domain entities to cache their own title as a persisted property.  That works, but is boilerplate and laborious.

      This ticket suggests that (unless a domain object opts out), we have an implementation of TitleFacet that looks up the title from an object's Bookmark/oid.   The cache implementation itself should be an SPI, with an in-memory as the default that could be enabled ; other alternatives would be Redis etc.

      Whenever an object is modified then the cache is updated. 

      Refinements:

      • The cache might also be time-limited (mru/lru), so that titles age out after time.
      • A background service might go around eagerly populating the cache

       

       

      Attachments

        Issue Links

          Activity

            People

              danhaywood Daniel Keir Haywood
              danhaywood Daniel Keir Haywood
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: