In a lot of frameworks/AMS/CMS I see folders of "helper" scripts and classes. What exactly do helper scripts and classes do? What is their specific purpose. Is that defined by the developer or is their a standard for their function?
Helper scripts, or template modules, are helper files that can make your templates more efficient by performing specific functions. For example, you can use helper scripts to interpret resource metadata, create files, and launch services.
Helper classes are usually a sign of lack of knowledge about the Model's problem domain and considered an AntiPattern (or at least a Code Smell) by many. Move methods where they belong, e.g. on the objects on which properties they operate on, instead of collecting remotely related functions in static classes.
I know that it means classes that help you in performing your tasks. It may be parsing a String in a specific way or some general purpose calculation one needs in various parts of its code.
Usually in Java (don't know php) they take the form of a bunch of static methods in a class named Util, or at least that's how I've always seen it.
From wikipedia
Helper classes are a term given to classes that are used to assist in providing some functionality, though that functionality isn't the main goal of the application.
Helper classes/scripts, in general, are utilities that are used by an application to perform certain tasks. Usually, these classes are created to centralize common task logic that is performed again and again throughout the application.
These utilities are often very specific, and perform 'actions' on data or objects within the application.
Common examples would be string manipulation, input parsing, encryption/decryption utilities, or mathematical calculations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With