Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-911

Simplify configuration with fluent API

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      As is, it is rather tedious sometimes to set every little configuration toggle using coarse APIs like GlobalConfiguration or Configuration. We could simplify this model and allow users to set related "units" of configuration using more "grouped" APIs as:

      class GlobalConfiguration { 
      
        MarshallerBuilder configureMarshaller(); 
      
      }
       
      class MarshallerBuilder { 
      
        MarshallerBuilder setInstance(Marshaller m);
      
        MarshallerBuilder setType(Class<? extends Marshaller> c); 
      
        MarshallerBuilder setVersion(String s); 
      
        MarshallerBuilder addProperty(String name, String value);
       
        MarshallerBuilder addProperties(Properties p);
      }
      

      And on top if we can use fluent API to make configuration setting even easier:

      globalConf.configureMarshaller().setType(MyMarshaller.class).addProperty("foo", "bar").setVersion("5.0");
      

              rh-ee-galder Galder ZamarreƱo
              vblagoje Vladimir Blagojevic (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: