Packaging & Managed Packages in Salesforce
What Is Packaging in Salesforce?
Packaging is how Salesforce groups metadata (Apex, objects, fields, flows) into a distributable unit that can be installed in other orgs.
Simple Explanation
Packaging is like creating a software app installer for Salesforce.
Gist (Quick Revision)
Packages bundle Salesforce components so they can be installed, reused, and upgraded.
1. Managed vs Unmanaged Packages
What Is an Unmanaged Package?
Unmanaged packages are simple bundles of metadata with no ownership protection.
Real-Life Example
Sharing a zip file—once shared, anyone can modify it.
Key Characteristics
-
No namespace
-
Code is editable after install
-
No upgrade path
-
Best for internal use
What Is a Managed Package?
Managed packages are protected, versioned apps typically built by ISVs (Independent Software Vendors).
Real-Life Example
Installing a paid app from an app store—code is protected and upgradable.
Key Characteristics
-
Uses a namespace
-
Code is locked (read-only)
-
Supports upgrades
-
Ideal for AppExchange apps
Easy Comparison Table
| Feature | Managed | Unmanaged |
|---|---|---|
| Code Protection | ✅ Yes | ❌ No |
| Namespace | ✅ Required | ❌ No |
| Upgrade Support | ✅ Yes | ❌ No |
| Best For | AppExchange | Internal sharing |
Gist (Quick Revision)
Managed packages protect code and support upgrades; unmanaged packages don’t.
2. Namespaces
What Is a Namespace?
A namespace is a unique prefix added to components in a managed package to avoid naming conflicts.
Simple Explanation
Namespace is like a surname—it distinguishes you from others with the same first name.
Real-Life Example
Two apps have a field called Status__c:
-
billing__Status__c -
sales__Status__c
No conflict because of namespaces.
Why Namespaces Matter
-
Prevent naming collisions
-
Identify package ownership
-
Required for managed packages
Gist (Quick Revision)
Namespaces uniquely identify package components and protect them from conflicts.
3. Versioning & Upgrades
What Is Versioning?
Versioning allows package creators to release new versions of a package over time.
Simple Explanation
Like updating your mobile app from v1.0 to v2.0.
Types of Versions
-
Major version – Breaking changes
-
Minor version – Enhancements and fixes
How Upgrades Work
-
Customers install a new version
-
Existing data remains intact
-
Code changes take effect
Best Practices for Safe Upgrades
-
Never remove fields or objects
-
Add new features gradually
-
Maintain backward compatibility
-
Use feature flags (Custom Metadata)
Gist (Quick Revision)
Versioning enables safe upgrades without losing customer data.
? Career Coach Advice (Interview-Ready)
Interviewers ask this topic to assess ISV and enterprise knowledge.
Strong interview answer:
“Managed packages use namespaces, protect code, and support versioned upgrades, while unmanaged packages are best for internal sharing.”
That answer shows AppExchange-level understanding.
✅ Final Takeaway
Packaging is essential for scalable Salesforce app development.
If code is meant to be shared, it must be packaged correctly.
