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

129
Vistas
Is there a problem in constantly been updating properties of an object created with singleton?

I'm using a Response object in order to create http responses. My responses are objects created with a function and using several parameters, one of these parameters is a string get from a method of an object that makes a quick query of some data inside the code itself.

The problem is that to every new Response represents a new Response object, and I'm trying to get a better performance creating the Response object with a singleton design pattern, but I don't know if there are some consequences because of being constantly updating the server´s running object´s properties to change the specified data I'm querying at every response time or even if there is a better way of getting a better performance without using a singleton design pattern.

In this example I18n.getString() is the method I would be constantly changing the parameters in order to get new data

const okResponse = function (data, locale) {
    return (new Response(200, "SUCCESS", true, I18n.getString(locale, 'ok-title'), I18n.getString(locale, 'ok-message'), data, {}, new Date())).toJSON()
}
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