+ Start a Discussion
teena jacobteena jacob 

Group apex classes like packages or namespaces

  Is there any way to group apex classes like packages or namespaces.

Best Answer chosen by teena jacob
Khan AnasKhan Anas (Salesforce Developers) 
Hi Teena,

Greetings to you!

Apex classes are stored in the classes folder in the corresponding package directory. You cannot create a package in Salesforce to put your class. Salesforce put all the classes in a default folder. Apex classes doesn’t support nested namespaces or packages like Java to organize code in a clean way.

You can use the naming convention for your Apex Classes i.e.; use some specific keyword when creating classes:
  • Prefixing class names: 
           eg.: page_AccountTable
  • Suffixing class names: 
           eg.: AccountTable_page

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas