What is the main difference between frame work and dynamic libra开发者_Python百科ry
At its heart, an OS X framework is a dynamically linked library. The Framework is a special directory structure called a "framework bundle" that contains one or more versions of the dynamically linked library, as well as dependent frameworks, resources, metadata, etc. Other "bundles" on OS X include .app bundles (which contain an executable as well as resources, dependent frameworks, etc...).
Dynamic library is a basic concept mostly independent from the specific platform, i.e. you can talk about dynamic libraries on OSX, Linux, Windows and mean the same basic thing - a piece of relocatable object code with exported API symbols that is composed in a way that allows it to be loaded and shared on demand by applications on the platform.
A framework is an OSX-specific term. It is a package which defines some commonly agreed upon directory structure and stores dynamic libraries, resources, description of the package and other relevant stuff at predefined locations. Which means that it has mostly semantical meaning which allows developers (and tools they create) to refer to it in a commonly understood way. It is worth noting that framework is not required to contain shared libraries at all.
The Anatomy of a Framework might be useful. Specifically the Versions/Current/MyFramework
mentioned in that example is a shared library. That section goes on to describe some of the other things that might exist in a framework bundle.
精彩评论