Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
Keeping same reference to object in system or not

I am wondering about one architectural problem.

Suppose I have several calls from api, at different times, that return me different objects and arrays. In these requests, sometimes there are the same objects whose key is id. I map them to class to have methods for them.

Should I make these objects have the same reference? Then it would be more convenient to call methods on these objects and they would update throughout the system. On the other hand it could cause some unexpected side effects.

How do you deal with such a problem? Do you have a general list of objects of a given type in your store and retrieve a reference from it when you need to assign it to another object? Or maybe you do not care about it, and even though it is theoretically one object with a given id, there are copies of it all over the system?

Or maybe you do not have nested objects and e.g. in the Car object there is only the engineId prop to search for it in the whole list?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda