- Bundle (NEXTSTEP)
Under
NEXTSTEP ,Mac OS X andGNUstep , a bundle is a directory that allows related resources such assoftware code to be grouped together. They were introduced into the Macintosh world as "packages" inMac OS 9 and are similar in concept to the Application Directories used inRISC OS and on theROX Desktop .Applications, frameworks, and
plugin s are most commonly grouped as bundles, although documents can also be grouped as bundles. They are manipulated with the NSBundle class in the NeXT Foundation kit, and with CFBundle underCore Foundation .A bundle usually contains one file representing executable code, and files that represent resources such as nibs, images, sounds, and other media. On other systems such as
Microsoft Windows , these resources are usually included directly in the executable file itself at compile time. On older Macintoshes, a similar technique is used, where additionalmetadata can be added to a file'sresource fork . Beginning with the Mac OS X, however, theNEXTSTEP concept of bundles was adopted for this purpose. Most types of bundles are used and interacted with as though they were ordinary files on the system in an attempt to reduce accidental tampering. A bundle also aims to ease problems associated with organizing resources by using a more simple structure ofhierarchical directories rather than the resource fork.The
Uniform Type Identifier (UTI) for a bundle is com.apple.bundle and for a package is com.apple.package.Application Bundles
Application bundles are often presented to users as a single file known as a "package". This file is really a directory ending in a .app extension. Control-clicking (or right-clicking) on the package allows a user to open up the bundle and see the contents. In an application, the first directory in the bundle is usually Contents; within contents there is usually another directory with the executable code (called MacOS for Macs, or the application's name for GNUstep), which contains the application's executable code, and a directory called Resources, which contains the resources of the application.
Among other things, the Resources folder contains localized versions of the application's nib files.
Other common subdirectories include Plugins, Frameworks, and Shared Frameworks. The Frameworks directory contains frameworks used by the application, and are used even if another version of the framework exists on the system. The Shared Frameworks directory contains frameworks that can be used both by the application that contains them, and other applications; they are used only if a newer version does not exist elsewhere on the system. Plugins contains extensible code used by the application.
The UTI for an application is com.apple.application and an application bundle is com.apple.application-bundle .
Loadable Bundles
Loadable bundles are bundles which contain code that can be loaded at runtime [ [http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingCode/Concepts/AboutLoadableBundles.html Code Loading Programming Topics for Cocoa: About Loadable Bundles ] ] . Loadable bundles usually have the extension .bundle and are most often used as
plug-ins . An example of application which traditionally supports bundles isApple Mail [ [http://www.tikouka.net/mailapp/ Apple Mail plug-ins and tools ] ] [ [http://hawkwings.net/plugins.htm Hawk Wings - Plug-ins for Apple Mail ] ] . On Mac OS X there is a way to load bundles even into applications that don't support them allowing for third party hacks for popular applications such as Safari [ [http://pimpmysafari.com/plugins/ Pimp My Safari: plugins ] ] .Other bundle formats
Other bundles include
Rich Text Format documents with images, which carry the .rtfd extension, OS X widgets, and partially downloaded files in Safari, which carry the .download extension. InGarageBand , Keynote,Pages , Numbers, iMovie HD andXcode the project files are also represented as bundles.Apple's installer packages (.pkg) are bundles that contain pax archives. See
Installer (Mac OS X) .There are many third-party Mac OS X applications which utilize their own custom bundle format (e.g.
CandyBar 's .iContainer bundles).References
ee also
*
Application Directory - theRISC OS analogue to an application bundle
* klik - A Linux application that makes use of similar principlesExternal links
* [http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/CFBundles.html Bundle Programming Guide] at Apple Developer Connection
* [http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSBundle.html NSBundle documentation] from the GNUstep project
* [http://www.sveinbjorn.org/platypus Platypus] - a tool to create application bundles around scripts
Wikimedia Foundation. 2010.