Wicket
  1. Wicket
  2. WICKET-4707

Remove ResourceReference.getDependencies()

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Later
    • Affects Version/s: 6.0.0-beta3
    • Fix Version/s: None
    • Component/s: wicket
    • Labels:
      None

      Description

      There is some duplication of functionality between the ResourceReference and HeaderItem layers.

      ResourceReferences should not be responsible for managing header contribution dependencies. This is the job of HeaderItem. ResourceReference's job is to provide a reference to a IResource. In that context, getDependencies() unnecessary.

      ResourceReference is the layer below HeaderItem, but implementation problems of HeaderItem have crept into the lower layer.

      In the same vein, IJavaScriptLibrarySettings should manage HeaderItems, not ResourceReferences. It is concerned with making sure that the correct header contributions have been made for the various Javascript things to work. This can be done entirely without ResourceReferences, but not without HeaderItems. The important things is the header items.

      Working on some patches...

        Activity

        Hide
        Jesse Long added a comment -

        I have had a look at this, and implemented changes to use HeaderItems widely instead of ResourceReferences. It saves a lot of JavaScriptHeaderItem.forReference() calls, but ultimately leads to more complicated code than is currently necessary in Wicket - especially with regard to resource bundles. For this reason, and because of the API changes for very little benefit I've giving up on the patch. Changes at https://github.com/jesselong/wicket/commits/WICKET-4707 if anyone cares. Sorry for the noise.

        Show
        Jesse Long added a comment - I have had a look at this, and implemented changes to use HeaderItems widely instead of ResourceReferences. It saves a lot of JavaScriptHeaderItem.forReference() calls, but ultimately leads to more complicated code than is currently necessary in Wicket - especially with regard to resource bundles. For this reason, and because of the API changes for very little benefit I've giving up on the patch. Changes at https://github.com/jesselong/wicket/commits/WICKET-4707 if anyone cares. Sorry for the noise.
        Hide
        Martin Grigorov added a comment -

        Closing with resolution "Later". No need to change this for now.

        Show
        Martin Grigorov added a comment - Closing with resolution "Later". No need to change this for now.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jesse Long
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development