java - Passing Entities as method parameters vs sending new object created from part of entity -


i list of @entityes query (so called main entities). have fill of transient fields in these entities values different queries / entities. each of these transient fields needs different combination of fields main entities , based on should run query , fill transient fields. these done in 3 4 different methods.

my question is, better approach in terms of performance , practice?

  1. pass main entities list (could in 100s) each of these methods , them filled in method or
  2. create object based on fields needed each method , result , fill entities?

when pass entities methods, not creating copies, passing original list? no performance related issues?

except primitive types, every object passed methods parameter passed reference. therefore won't create copies of entities if pass list<entityclass> object methods.

if there isn't other reason not so, go option 1 , pass list of entities methods.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -