I have recently come across a very bad piece of code. Here is the idea. It is a service that basically takes camera stream configuration, takes snapshot and saves the stream + snapshot + some additional info for further use. This service is called every time a new stream is added or when the stream needs to be updated. Here is the roughly sketched idea. CameraService @Service public class CameraService() { @Autowired private CameraRepository cameraRepository; @Autowired private SnapshotService snapshotService; public Camera updateCamera(CameraConfiguration configuration) { Camera updatedCamera = cameraRepository.