Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-17199

Improve the usability of the abstract configuration interface

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      Problem
      Consider an example of generating configuration interfaces (*Configuration) for an abstract configuration.

      Configuration schemas:

      @AbstractConfiguration
      public class BaseConfigurationSchema {
          @Value
          public int size;
      }
      
      @Config
      public class VolatileConfigurationSchema extends BaseConfigurationSchema {
          @Value
          public double evictionThreshold;
      }
      

      Configuration interfaces:

      public interface BaseConfiguration<VIEWT extends BaseView, CHANGET extends BaseChange> extends ConfigurationTree<VIEWT, CHANGET> {
          ConfigurationValue<Integer> size();
      }
      
      public interface VolatileConfiguration extends BaseConfiguration<VolatileView, VolatileChange> {
          ConfigurationValue<Integer> size();
      }
      

      This implementation allows us to work with the inheritors of the abstract configuration as with a regular configuration (as if VolatileConfigurationSchema did not extend BaseConfigurationSchema), but when working with the abstract configuration itself, it creates inconvenience.

      For example, to get a view of the abstract configuration, we will need to write the following code:

      BaseConfiguration baseConfig0 = ...;
      BaseConfiguration<?, ?> baseConfig1 = ...;
              
      BaseView baseView0 = (BasePageMemoryDataRegionView) baseConfig0.value();
      BaseView baseView1 = baseConfig1.value();
      

      Which is not convenient and I would like us to be able to work in the same way as with the VolatileConfiguration.

      Possible implementations

      • Simplest is to leave it as is;
      • Creates an additional configuration interface that will be similar to BaseConfiguration, for example BaseConfigurationTree, but it will be extended by BaseConfiguration and all its inheritors like VolatileConfiguration, then there may be confusion about whether to use BaseConfiguration or BaseConfigurationTree in the end, so we need to decide how to create a name for such an interface;
        • BaseConfigurationTree;
        • AbstractBaseConfigurationTree;
        • other.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            ktkalenko@gridgain.com Kirill Tkalenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment