-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Salesforce Platform Enterprise Architecture- fourth edition
By :

A package is a container that holds your application components, such as Custom Objects, Apex code, Apex Triggers, Visualforce pages, Lightning Components, and so on. This makes up your application. While there are other ways to move components between Salesforce orgs, a package provides a container that you can use for your entire application or to deliver optional features by leveraging so-called dependent packages.
Salesforce has evolved its packaging technology and now refers to its legacy packaging technology as 1GP (1st Generation Packaging) and its latest technology as 2GP (2nd Generation Packaging). This book uses 2GP exclusively – keep this in mind when reviewing Salesforce documentation on the packaging.
There are two types of second-generation packages – managed and unlocked. Unlocked packages also result in the installation of components in another org; however, the metadata can be readily modified or even deleted by the administrator of that org. While they can be used for upgrades, changes made in an installation org will be overwritten. Given these attributes, they are not particularly ideal from a support perspective, which also makes managed packages more appropriate for ISVs distributing their application to multiple customers. Moreover, unless you use managed packages, the Apex code that you write is also visible for all to see, so your intellectual property is at risk unless you use managed packages.
Unlocked packages can be used for sharing template components that are intended to be changed by the subscriber. If you are not using GitHub or the GitHub Salesforce Deployment Tool (https://github.com/afawcett/githubsfdeploy), they can also provide a means to share open source libraries with developers.
This book was inspired by building packaged applications for distribution on AppExchange, as an ISV developer. However, many of the practices and tips equally apply to building robust and scalable applications within a growing or enterprise-size organization using packages. Where aspects are applicable to one or the other types of development this will be called out.
Managed packages have the following features, which are ideal for distributing your application as an ISV. The org where your application package is installed is referred to as a subscriber org since users of this org subscribe to the services your application provides:
There are other benefits to managed packages, but these are only accessible after becoming a Salesforce partner and completing the security review process; these benefits are described later in this chapter. Salesforce provides ISVforce Guide (otherwise known as the Packaging Guide), in which these topics are discussed in depth – bookmark it now! The ISVforce Guide can be found at https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/.
The following features are applicable to both unlocked and managed packages: