Where is the Best Place for Cron Methods ? |
02-16-2023, 02:49 PM
(This post was last modified: 02-16-2023, 02:51 PM by evansharp. Edit Reason: clarity )
You should follow a DRY (Don't Repeat Yourself) approach to these methods. If they're actions only performed by the cron job via you cron controller, then I'd say writing a private cron controller method to perform them makes sense. If these are methods that properly belong in another class because of the resources they need or semantics, then you could look at calling them statically from the cron controller or else instantiating their class in the cron controller.
In any event, don't create duplicates of the methods. Put them somewhere according to where they fit. Namespacing makes this pretty painless. |
Messages In This Thread |
Where is the Best Place for Cron Methods ? - by RedWd - 02-03-2022, 02:07 AM
RE: Where is the Best Place for Cron Methods ? - by Kerry Watson - 02-04-2022, 05:20 AM
RE: Where is the Best Place for Cron Methods ? - by RedWd - 11-19-2022, 07:37 AM
RE: Where is the Best Place for Cron Methods ? - by evansharp - 02-16-2023, 02:49 PM
RE: Where is the Best Place for Cron Methods ? - by SharphSonirtm - 03-27-2023, 11:53 PM
RE: Where is the Best Place for Cron Methods ? - by Soliu - 06-19-2023, 09:40 AM
|