Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the naming conventions for Mac and iOS frameworks? [closed]

Or put another way:

What are the 'Kit', 'Toolbox', 'Core', and 'Foundation' prefix/suffix naming conventions in Mac and iOS frameworks?

Going through Apple's frameworks these prefixes and suffixes seem to follow a pattern but I haven't found anything in the docs explaining the exact differences. This is the basic pattern I see:

  • Foundation - low level, C/Objc
  • Core - mid, C/Objc
  • Toolbox - general services
  • Kit - high, Objc

Also there is some inter mixing of these names that I guess means the framework is a mix between both levels of abstraction. For example Core Foundation and Core Audio Kit.

Also do popular third party frameworks follow these conventions very closely? RestKit fits well since it is high level however CorePlot seems like CoreKit would have been a better if not for google collisions with the javascript library of the same name.

like image 401
Steve Moser Avatar asked Apr 16 '13 13:04

Steve Moser


People also ask

What are naming conventions?

A naming convention is a convention (generally agreed scheme) for naming things. Conventions differ in their intents, which may include to: Allow useful information to be deduced from the names based on regularities.

What are frameworks in Mac?

A framework is a hierarchical directory that encapsulates shared resources, such as a dynamic shared library, nib files, image files, localized strings, header files, and reference documentation in a single package.

What is a framework IOS?

A framework is a bundle (a structured directory) that contains a dynamic shared library along with associated resources, such as nib files, image files, and header files. When you develop an application, your project links to one or more frameworks.


1 Answers

I wouldn't name it a convention, it has to do with the Architecture of Cocoa. I'm gonna try to answer using iOS Architecture but it's the same for Mac.

Architecturally iOS is divided into 4 main layers

  • Core OS: It't basically the kernel
  • Core Services: This is where Foundation and Core Foundation lays, so it manipulates Strings, Collections, etc. it also manipulates hardware features like GPS here you will find Core Motion, Core Location, but also System Configuration. This layer is also known as Core Frameworks layer cause it handles the base frameworks of the OS.
  • Media: As you may guess it handles media (Audio, Video & Graphics) So you will find frameworks like Core Graphics, Core Animation, Core Audio but also OpenGL ES and AVFoundation
  • Cocoa Touch: Here you will find high level frameworks that supports applications, some of the frameworks are the UI Kit, the Game Kit but also the Message UI, Address Book UI and even single names like iAd or Social frameworks

Every layer depends on the previous one. So why does Apple choose that names? Well normally they use the word Core to refer to the base of the frameworks (the kernel), generally this are low level frameworks that directly manipulate basic operations (in hardware or from the OS). A clear example is Foundation that is basically an object oriented wrapper of Core Foundation or AVFoundation that relies on Core Animation, Core Audio and Core Media so as you can see foundation suffix is not the lowest level, it depends on the architecture. Normally you would use the word toolbox to provide interfaces for accessing certain types of external files/devices or support for managing them. Normally you would use the word kit when providing a set of tools that you can use right out of the box on your Apps.

In short, the goal of naming a framework is to understand the clases it contains based on the architecture's design. But as I said before I wouldn't say it's a 'convention' it's more like a 'good practice'.

like image 188
German Gil Avatar answered Oct 17 '22 11:10

German Gil