thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (THRIFT-4822) Convert bool CTOR flags into enum type
Date Thu, 14 Mar 2019 08:10:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jens Geyer updated THRIFT-4822:
-------------------------------
    Summary: Convert bool CTOR flags into enum type  (was: Convert bool flags into enum type)

> Convert bool CTOR 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
>            Priority: Major
>
> 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)

Mime
View raw message