alibaba / alibaba/Alibaba-Java-Coding-Guidelines
Question for using wrapper class at POJO
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 1.1k
- Fork
- 246
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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. 🙏
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia dalle regole OOP collegate, in particolare dalla regola 8 e dalle relative indicazioni sui tipi primitivi e wrapper. Un risultato utile sarebbe una spiegazione o un chiarimento della regola approvato da un maintainer, ma l’issue non indica alcun file di documentazione né alcun test da aggiornare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100