Camel
  1. Camel
  2. CAMEL-547

remove cycle between builder and spi

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.4.0
    • Component/s: camel-core
    • Labels:
      None

      Description

      Currently the spi package references builder.RouteBuilder. This creates a bad cycle in Camel as builder is one of the top level packages and spi is one of the lowest level packages. The method where RouteBuilder is used is in CamelContext.addRoutes(RouteBuilder builder). I think this reference is not necessary. CamelContext already has a method addRoutes(Collection<Route> routes).

      So instead of calling camelContext.addRoutes(builder) I think the better way would to call:
      builder.setContext(camelContext);
      builder.addRoutesToContext(); // This is a new method that replaces the functionality of CamelContext.addRoutes(RouteBuilder builder)

      This way we will also cut some part of the cycle between impl and builder. impl.DefaultCamelContext references both RouteBuilder and BuilderSupport from the builder package. Both will not be necessary anymore as as soon as we get rid of the addRoutes method.

      This way CamelContext does not have to know anything about it´s builder. What do you think about this change?

      1. routecontext.patch
        2 kB
        Christian Schneider
      2. Main cluster (11).png
        27 kB
        Christian Schneider

        Issue Links

        There are no Sub-Tasks for this issue.

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Hadrian Zbarcea
              Reporter:
              Christian Schneider
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development