SA-MP Forums Archive
Factory method while saving player state, yes or no? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Factory method while saving player state, yes or no? (/showthread.php?tid=661389)



Factory method while saving player state, yes or no? - nikotragedy - 02.12.2018

Hey guys!
I have a specific include for database handling and I'm wondering if I should save each field (position, including x pos, z, y, a, interior, vw; maybe another method for the money, and so on) so I could re-use the code or if I should use one or two queries to do that.

Pros of factory:
- I can reuse code whenever I want
- Easy to read and mantain code

Cons:
- Too many queries?