Git Product home page Git Product logo

blueprint's People

Contributors

filmil avatar wayward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

filmil

blueprint's Issues

Map custom configuration paths to methods

Methods are currently mapped to paths in the configuration in a fixed manner (by method name). Allow both:

– Overriding individual method's path, e.g. with an annotation: @Named("timeout") int getTimeout().
This poses a specific problem: paths with more than one component will need to be given either as arrays or as a string with delimiters. If using delimited strings, the delimiter must be appropriate for the configuration source, but this is a run-time concern and should not leak into the API. E.g. @Named("foo.bar.baz") is syntactically a 3-component path in Properties, but in XML it is a single tag name. Slashes ("/") would be appropriate for XML, but not necessarily for all other source types.

– Specifying the mapping strategy at creation time (one could be: build paths by stripping JavaBeans-style getter prefixes).

Check if a key is present

Sub-interface methods are instantiated even if the corresponding configuration key is missing. Find a way to signal to the user that there is nothing interesting under them (return null?) Make sure it doesn't play foul with validations and default values.

Custom type providers

Let the programmer specify custom deserializers for types not supported out-of-the-box.

Define and make apparent the different meanings of "validation"

Blueprint talks about "validation" in three different contexts:

  • whether the configuration is syntactically correct;
  • whether all the method calls from the blueprint interface will complete successfully;
  • asserting that the validation constraints are met.

These three levels of validation need to be disentangled and offered as a choice to the user (with reasonable defaults).

Refactor Source

Rework Source to expose a tree-like structure (node: { name, value, children }).
This will help write new Source impl's more easily.

Proxy improvements

Each proxy object is associated with a node in the configuration tree, but it can only access subnodes by name.
Provide proxy objects with an interface to:
– obtain the value associated with the current node ("here" value);
– collect all unclaimed keys in the current node ("&rest" map).

Output

Updating and saving configuration objects for supported sources (e.g. readable files; not available for system properties, environment variables, etc.)

Default values

Allow attaching default values to methods. Specify the behavior when both default value and validation constraint(s) are given.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.