GitHub user RocMarshal added a comment to the discussion: StreamPark 
code-style-and-quality Improve

> Add a rule: Enumeration type must have a suffix of "Enum", e.g: UserTypeEnum, 
> ResourceTypeEnum.

Hi, @wolfboys Thanks for the suggestion~

Undoubtedly, the rule will improve readability. However, in some cases, it can 
make the declaration line of the enumeration type particularly long. This 
requires us to be as concise as possible when defining enumeration classes, and 
when using static methods referenced by enumerations, this issue can be 
magnified. Of course, in response to this issue, we can limit the use of static 
import methods when calling static methods to alleviate this problem.
The current IDE is already able to quickly know the type of a variable, and 
enumerating classes are not as complex as variables of type Map<>. It only 
represents the type, while map needs to reflect on the name that the variable 
maintains a mapping relationship. Perhaps I didn't express the difference very 
well, but it's like the definition of Map and enumeration. When defining the 
implementation class of Map, it needs to be declared with the `class` keyword, 
while the enumeration class needs to be declared with the `enum` keyword.

Of course, I'd like to hear more opinion/advice from you & others.

GitHub link: 
https://github.com/apache/incubator-streampark/discussions/2915#discussioncomment-6808313

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to