🧠 Why Aren’t More Salesforce Developers Using Design Patterns? Whenever I chat with Salesforce devs who’ve got 3+ years of experience, I notice a common gap: 👉 Solid Apex skills, but weak understanding of design patterns. Not because they’re not smart. But these patterns often feel abstract, over-engineered, or hard to apply in real Salesforce projects. So I decided to do something about it. 📘 I’ve put together a set of straightforward, no-fluff notes on common Salesforce design patterns—tailored specifically for real-world projects. Think of them as: ✅ A reference guide during crunch time ✅ A bridge between writing code and thinking like an architect ✅ A tool to level up your dev game without the overwhelm Read more https://lnkd.in/grkmxfdC
Thanks for sharing! Regarding the service layer and how you defined it, I’d like to bring a different approach to implement it: Instead of putting the entire logic for an entity in a generic service class, let’s break it down into more specific services. In your example, all you have is a single method to assign a Sales Manager to Opportunities. It is simple and easy to follow, but what would happen to that service when you have lots of different methods, including private methods, SOQL and so on? That class has the potential to become really complicated. Maintaing the test class may become a challenge too. So, instead, I would have specific services, which do one thing only. Talking about your example, I’d have a service dedicated to assigning sales managers to opportunities, and that would be it. Ideally, you’d know what a service does just by reading its name. What do you think? Does that make sense?
Thanks for sharing this, Arpit! Also, for anyone looking to dive deeper with clear, step-by-step video lectures, I highly recommend checking out this https://www.youtube.com/watch?v=nU4TKRFzdx4&list=PL0wESsiWMBTplo_vgZajNEwbl_P0HXuTZ lecture series by Matt Gerry. It’s hands down one of the best resources out there for Salesforce devs covering Separation of Concerns and various design patterns using the Apex Common Library with YouTube lectures, wiki pages, and Blogs on each topic. Absolute gold!
Thanks for sharing, Arpit, much needed for mid level developers
Thankyou for sharing this! I am guilty for not following design patterns hopefully this will help me out!
Thanks for sharing, Arpit
Thanks for sharing, Arpit
Thanks for sharing, Arpit
Thanks for sharing 👏
Good stuff Arpit Vijayvergiya ! Thanks for sharing 👍
Thanks for this, Arpit. Great article and examples. Here's a couple reasons why I think we don't see design patterns as well: Because we don't talk about them enough. We don't do enough pair programming. We don't reject enough PR reviews. Trailhead doesn't cover it in depth. We don't mentor folks enough. We inherit procedural code. We don't do code reviews. We don't form guilds.