Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2205

Add Exclusion Filters to IOCUtilities

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.3.7, 5.4, 5.3.8
    • None
    • tapestry-ioc
    • None

    Description

      IOCUtilities provide the method addDefaultModules(builder) to automatically add all the libraries in the classpath.

      However, when modules conflict, a module is broken, the current environment does not match modules's preconditions the application can't be easily started: either each single module but the broken one(s) must be loaded manually or broken service(s) are overridden.

      Having the possibility to specify a filter over the modules found in the classpath seems to be a suitable improvement. In this way one can simply invoke IOCUtilities.addDefaultModules(builder, filter); to obtain the needed configuration.

      An example to reproduce such a situation:
      Create a project that depends only on tapestry-ioc, tapestry-beanvalidator, and other locally provided modules. tapestry-core not included. At startup the application fails because one service inside tapestry-beanvalidator cannot be created. The solution is to NOT include tapestry-beanvalidator as module, but just to keep it as dependency of the project, and then (manually in the local appModule) redefine a subset of its services.

      Attachments

        Activity

          People

            Unassigned Unassigned
            alessiogambi Alessio Gambi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: