Hacker News new | ask | show | jobs
by ryanthejuggler 4116 days ago
If there's the potential for multiples then I'll have a CameraManager (TheCameraManager) that finds out what's connected to the system and provides enumeration and access. I'll generally try to make the cameras look like a singleton and hide the Camera class. Sort of like a factory, except you'll only ever get N instances of your Camera class for N cameras.