request #32274 Simplify Artifact link field
    Joris MASSON (jmasson)
    2023-06-05 12:35
    2023-05-25 15:07
    Simplify Artifact link field

    As our experience with hybrids and hexagonal architecture grows, some early choices made during the work on the Artifact links field (of the Artifact modal) appear to have been wrong.

    1. The LinkFieldController should be in Domain, not in UI adapter. The controller holds the most business logic. We tried making it return "presenter" objects (like PHP), which is why we set it in the UI adapter. In retrospect, it was a bad idea, it should only handle Domain objects and nothing else. The UI (here a hybrids component) receives it and calls its function to do its job. The UI can even wrap Domain objects into presenters, but the controller's job should be holding the logic and knowing about the operations (such as marking a link to be removed, adding and removing new links, retrieving parents, etc.).
    2. Memory adapters have been a mistake. There is no need to abstract away "holding objects in memory", it makes the code very complicated for no benefit. Instead, the LinkFieldController should hold things in memory. At submit time, it is easy to ask it for its memory contents and format them correctly for REST. This will simplify the whole controller a lot (way fewer constructor injections).
    3. ArtifactLinkSelectorAutoCompleter should not fetch items by itself. It should ask the host controller. The controller should know about all the async operations and deal with faults in a uniform manner. The autocompleter should be a simple UI component that calls the right controller functions and assigns the right properties on the HostElement, and that's it.
    4. The ArtifactLinkListDuplicateRemover should be in REST adapter, not in UI adapter.
    Agile Dashboard
    • [ ] enhancement
    • [x] internal improvement
    Joris MASSON (jmasson)
    Under implementation
    Referencing request #32274
    Referenced by request #32274


    User avatar
    Joris MASSON (jmasson)2023-05-25 15:12
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes