- Issue created by @Liam Morland
- ๐ฎ๐ณIndia syam kumar
syam kumar โ made their first commit to this issueโs fork.
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
What is the reason for using dependency injection and non-static methods for this? This way it will have to persist an instance of
DeleteUsersBatch
in the batch process. I don't think that is an improvement. - ๐ฎ๐ณIndia syam kumar
I agree with your point, and I would like to add a few observations:
1. Single Job Execution Issue:
In the current implementation, all users deletion activities are being executed within a single batch job operation. This design does not differ significantly from a traditional, monolithic deletion process. The primary advantage of batch jobs is to efficiently manage resources by breaking operations into smaller, manageable chunks.2. Dynamic Service Loading:
The required Drupal services are currently being loaded dynamically, which is typically more suited for procedural code (e.g., within `.module` files). However, Drupal best practices recommend using Dependency Injection (DI), especially in object-oriented components such as services, controllers, and plugins. Additionally using DI, makes it significantly easier to write unit tests.