alibaba / alibaba/Alibaba-Java-Coding-Guidelines
Question for using wrapper class at POJO
- 主要語言
- 沒有語言資料
- 星號
- 1.1k
- 分支
- 246
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Sorry, I don't know where is a suitable place to discuss the question, so I just open an issue here to ask my question.
I have a question about the 8th point of [OOP rules](https://github.com/alibaba/Alibaba-Java-Coding-Guidelines#oop-rules).
> 8. [Mandatory] Rules for using primitive data types and wrapper classes:
1) Members of a POJO class must be wrapper classes.
2) The return value and arguments of a RPC method must be wrapper classes.
3) [Recommended] Local variables should be primitive data types.
Based on this rule, it will only allow us to use the primitive type in local variables. Then, we need to use wrapper classes in all other places.
The thing is that most of the suggestions I saw at the Internet is we should avoid wrapper classes as much as possible.
The reasons are
- performance
- memory footprint
So could anybody explain the reason behind this rule? Thanks. 🙏
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
從連結的 OOP 規則開始,尤其是規則 8 及其關於 primitive 類型和 wrapper 類型的指引。一個有用的成果是取得 maintainer 核准的規則說明或釐清,但 issue 沒有指出要更新的文件檔案或測試。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- documentation
- Issue 類型
- 文件
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 20/100