Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!