alibaba / alibaba/Alibaba-Java-Coding-Guidelines
Question for using wrapper class at POJO
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 1.1k
- Forks
- 246
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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. 🙏
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Empieza por las reglas OOP enlazadas, especialmente la regla 8 y sus indicaciones sobre tipos primitivos y wrapper. Un resultado útil sería una explicación o aclaración de la regla aprobada por un maintainer, pero el issue no menciona ningún archivo de documentación ni ninguna prueba que actualizar.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 20/100