function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SainSain 

What is the diff b/w utility and helper class?

Hi,

What is the diff b/w utility and helper class? please help me with example..

Thanks in Advance 
Jai ChaturvediJai Chaturvedi
Hi Sain,

A Utility class is understood to only have static methods and be stateless. You would not create an instance of such a class.

A Helper can be a utility class or it can be stateful or require an instance be created.

Create Utility class if you want to have methods that are used by several operations. Like method to genrate random number.

Create Helper class for storing codes for specific object/requiremnts. Like creating helper classes to store code for object triggers.


Mark this as solution if it helps you out.


Thanks
Jai