Advanced 25 min read

Packaging: Unlocked and Managed (Overview)

By the end of this lesson, you'll be able to:

  • Explain what a package is and the problem it solves for larger projects
  • Distinguish an unlocked package from a managed package at a high level
  • Recognize when packaging becomes worth adopting

Prerequisites: "Source Tracking"

What a package is

A package groups related metadata — Apex classes, objects, everything for one coherent piece of functionality — into a single unit that can be versioned (like 1.2.0) and deployed as a whole, rather than deploying every individual file separately every time.

Unlocked packages: for your own org(s)

An unlocked package is meant for deploying your own metadata across your own orgs — a large internal application might be split into several unlocked packages (say, one for the "Client Health Dashboard" feature from Module 35, one for "Payment Gateway" from Module 39), each independently versioned and deployed, rather than one giant undifferentiated codebase.

Managed packages: for distributing to other orgs

A managed package is built for distribution outside your own org — this is how AppExchange products are packaged and sold, with the package's internal code protected (not directly editable by the installing org) and namespaced (Module 13's namespace lesson) to avoid naming collisions with the installer's own code.

Exercise

As a comment, decide whether an unlocked or managed package fits: a company building internal Apex tools used only within their own three Salesforce orgs (dev, staging, production).

Show hint

Think about whether this code will ever leave the company's own orgs.

APEX

Packaging: Unlocked and Managed (Overview) Quiz

1. What is the key difference between an unlocked and a managed package?

Log in to submit the quiz and save your score.

My Notes

Log in to keep private notes on this lesson.

Questions about this lesson

No questions yet — be the first to ask.

Log in to ask a question about this lesson.

Summary

A package bundles related metadata into a single deployable, versioned unit — an overview of what packaging offers, without going deep into building one.