7 Replies Latest reply on May 11, 2011 8:56 AM by Keith Babo

    When implementing configuration ...

    Keith Babo Master

      I just added configuration support for Atom bindings through the Camel component here.  While doing so, I uncovered some areas where I don't think we've reached agreement in terms of a consistent approach.  If you check out the link, you'll notice the following in the code:


      • The model implementation has a no-arg constructor which allows the configuration model to be created from scratch.  This is required in order to provide tooling support and is useful for testing.
      • The model interface defines getters and setters for configuration values (see previous bullet).
      • The model implementation does not store configuration values in local variables - it relies on the underlying configuration model for storage.
      • Unit tests cover
        • Creating a model from scratch
        • Reading an existing model
        • Writing a model


      I'm not saying the above is absolutely right, but I am raising it as a potential set of best practices for developing config support.  For others that have used the config APIs, I would like to hear your opinion on this approach.  We are going to start writing a lot more config models in the near future, so now's the time to work this out.