Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4822

Refactor bool CTOR flags into enum type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.13.0
    • netstd - Library
    • None

    Description

      Certain CTORs accept two boolean flags

      public SomeTransport( arg1, arg2, ..., bool useBufferedSockets = false, bool useFramedTransport = false)

      The only valid combinations here are in fact (false,false), (true,false), (false,true) - the forth combination does not make sense because framed by design already acts as a buffer. Not to mention, that multiple boolean arguments are usually less coder-friendly.

      Therefore, the parameterlist should be shortened to the more readable, maintainable and concise style like so (proposal):

      public enum Buffering {
          None,
          BufferedTransport,
          FramedTransport
      }
      
      public SomeTransport( arg1, arg2, ..., Buffering buffering = Buffering.None)
      

      Attachments

        Issue Links

          Activity

            People

              jensg Jens Geyer
              jensg Jens Geyer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m