Daniel Keir Haywood created CAUSEWAY-3705:
---------------------------------------------
Summary: Introduce a TitleCachingService SPI
Key: CAUSEWAY-3705
URL: https://issues.apache.org/jira/browse/CAUSEWAY-3705
Project: Causeway
Issue Type: New Feature
Components: Core
Affects Versions: 2.0.0
Reporter: Daniel Keir Haywood
Fix For: 2.1.0
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
--
This message was sent by Atlassian Jira
(v8.20.10#820010)