alibaba / alibaba/Alibaba-Java-Coding-Guidelines
Question for using wrapper class at POJO
- Linguagem predominante
- Sem dados de linguagem
- Estrelas
- 1.1k
- Forks
- 246
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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. 🙏
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Comece pelas regras OOP vinculadas, especialmente a regra 8 e suas orientações sobre tipos primitivos e wrapper. Um resultado útil seria uma explicação ou esclarecimento da regra aprovado por um maintainer, mas a issue não menciona nenhum arquivo de documentação ou teste a ser atualizado.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- documentation
- Tipo de issue
- Documentação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 20/100