Jens Geyer created THRIFT-4822:
----------------------------------

             Summary: Convert bool flags into enum type
                 Key: THRIFT-4822
                 URL: https://issues.apache.org/jira/browse/THRIFT-4822
             Project: Thrift
          Issue Type: Improvement
          Components: netstd - Library
            Reporter: Jens Geyer


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):

{code}
public enum Buffering {
    None,
    BufferedTransport,
    FramedTransport
}

public SomeTransport( arg1, arg2, ..., Buffering buffering = Buffering.None)
{code}









--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to