The most powerful characteristic of the Salesforce platform is its extendability. From minor configuration tweaks to custom built functionality, it surpasses the out-of-the-box domain of capabilities. Salesforce has addressed the challenge of meeting the requirements of a wide spectrum of potential customers, by making rich customizations possible.
As the complexity of customization increases, there is a need to recognize distinct feature extensions, control their area of responsibility, and keep track of their respective components and dependencies. The possibility of deploying, porting, disabling, versioning, etc. the features created as extensions of the standard platform, as logical whole elements, is required.
A pillar of the Salesforce customization mechanisms, which addresses those needs, is the AppExchange Application, or managed packages.
The main purpose of a managed package is to bind code and configuration elements into a single entity. Those can be logical functional modules, re-usable code libraries, or entire sub-systems containing the functionality of a business channel.
A good analogy for AppExchange is the AppStore for iPhone or the Plugin Marketplace for the Eclipse IDE. When a managed package is publically distributed through AppExchange, it becomes a universal product, which may be installed safely on any instance of a Salesforce org. The AppExchange packages have powerful mechanisms of encapsulation and security, protecting from interfering with any local customizations of a given org or other managed packages. Managed package defined dependencies allow one managed package to further extend another.
In technical terms, another way to look at managed packages is to compare them to Java JAR and WAR containers. Managed packages protect their own codebase and components; they run in a separate execution scope with extra governor limit resources allocated; they can be versioned, disabled, rolled-back or updated, all independently of the rest of the Salesforce org.
This is the only name-spacing mechanism, which Salesforce provides. It is used to split large codebases and numerous configuration elements into manageable chunks. This allows projects to grow sustainably.
Managed applications usually communicate through interfaces or access each other’s database elements directly, when specifically needed, by means of dependencies. The mechanisms of encapsulation, enforced by the platform, limit failure points, preserve functional integrity and protect private elements. They also allow managed packages to use an extra number of elements, regardless of the type of Salesforce environment. For example, custom objects from a managed package do not count against the total limit of an environment.