Project 1999

Go Back   Project 1999 > General Community > Off Topic

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-27-2018, 12:22 PM
maskedmelon maskedmelon is offline
Planar Protector

maskedmelon's Avatar

Join Date: Nov 2011
Location: not far from here
Posts: 5,795
Question OOP and "Manager" Classes for Common Code🤔

If I am writing a piece of software and it is going to have many instances of a few different types of objects is it better to aggregate common/repetitive code for updates into a "manager" type class than having all that code replicated across hundreds or thousands of objects?

For example, if I have an object, say, a Collider and it contains a collision box and maybe a method for correcting position on collision, is it better to implement the code for detecting collisions within that object or within a separate CollisionManager class that could iterate over all active colliders to check for collisions?

I wouldn't think it would make a difference either way for speed, but it seems liek it would use a lot less memory to house all the collision code in a single instance than duplicating it across many objects.
__________________
<Millenial Snowfkake Utopia>
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:37 AM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.