Download high resolution version (1417x1047, 247 KB)A Cocoa application being developed in Xcode. This is a screenshot of a copyrighted website, video game graphic, computer program graphic, television broadcast, or film. It is believed that screenshots may be exhibited on Wikipedia under the fair use provision of United States...
Download high resolution version (1417x1047, 247 KB)A Cocoa application being developed in Xcode. This is a screenshot of a copyrighted website, video game graphic, computer program graphic, television broadcast, or film. It is believed that screenshots may be exhibited on Wikipedia under the fair use provision of United States...
 A Cocoa application being developed using A new Cocoa project in Xcode. Xcode is Apple Computers integrated development environment (IDE) for developing applications and other software for Mac OS X. It is shipped free with Mac OS X 10.3 Panther, but is able to develop OS X applications that can run on any version...
Xcode. A user interface builder is a computer software program that allows easy and visual creating and editing of a graphical user interface to be used in a program. Some notable examples follow, sorted by widget toolkit. GTK+ Glade Interface Designer Qt Ebuilder [1] Qt Designer [2] Qt Architect [3] Windows...
Interface Builder windows are also visible. Cocoa is Apple Computer, Inc. ( NASDAQ: AAPL) is a Silicon Valley company based in Cupertino, California, whose core business is computer technologies. Apple helped start the personal computer revolution in the 1970s with its Apple II and shaped it in the 1980s and since with the Macintosh. Apple is known for innovative...
Apple Computer's native Object-oriented programming (OOP) is a computer programming paradigm in which a software system is modeled as a set of objects that interact with each other. Object-oriented programming emphasizes the following concepts: Objects - Packaging data and functionality together into units within a running computer program; objects are the basis...
object-oriented application programming environment for the Mac OS X is the latest version of the Mac OS operating system for Macintosh computers. The operating system was first commercially released in 2001. It consists of two main parts: Darwin, an open source Unix-like environment which is based on the BSD source tree and the Mach microkernel...
Mac OS X In computing, an operating system (OS) is the system software responsible for the direct control and management of hardware and basic system operations. Additionally, it provides a foundation upon which to run application software such as word processing programs and web browsers. In general, the operating system is the first...
operating system. It is one of five major programming environments available for Mac OS X; the others are Carbon is the codename of Apple Computers APIs for the Macintosh operating system, which permits a good degree of backward compatibility between source code written to run on the classic Mac OS, and the newer Mac OS X. The APIs are published and accessed in the form of C...
Carbon, Classic is an application on Mac OS X that can load at boot, on command, or when a classic Mac OS applicaton is loaded. Classic allows Mac OS X to run classic applications with out having to Dual boot or reboot into clasic Mac OS. Classic is a descendent from...
Classic, BSD redirects here; for other uses see BSD (disambiguation). Berkeley Software Distribution (BSD) is the name of the UNIX derivative distributed in the 1970s from the University of California, Berkeley. The name is also used collectively for the modern descendants of these distributions. History AT&T Bell Laboratories permitted...
BSD, and The Java platform consists of: The Java virtual machine The Java API In addition to the Java programming language itself, the following languages were specifically designed for the platform: Groovy Pizza GJ Categories: Java platform | Stub ...
Java. (Environments such as Programming Republic of Perl logo Perl, also Practical Extraction and Report Language (a backronym, see below), is a programming language released by Larry Wall on December 18, 1987 that borrows features from C, sed, awk, shell scripting (sh), and (to a lesser extent) from many other programming languages. Rationale Perl...
Perl and Python is an interpreted, interactive programming language created by Guido van Rossum in 1990, originally as a scripting language for Amoeba OS capable of making system calls. Python is often compared to Tcl, Perl, Scheme, Java, and Ruby. Python is developed as an open source project, managed by the non...
Python are considered minor environments because they are not generally used for full-fledged application programming). Cocoa applications are typically developed using the development tools provided by Apple, specifically A new Cocoa project in Xcode. Xcode is Apple Computers integrated development environment (IDE) for developing applications and other software for Mac OS X. It is shipped free with Mac OS X 10.3 Panther, but is able to develop OS X applications that can run on any version...
Xcode (formerly Project Builder) and Interface Builder. However the Cocoa programming environment can be accessed using other tools, such as Programming Republic of Perl logo Perl, also Practical Extraction and Report Language (a backronym, see below), is a programming language released by Larry Wall on December 18, 1987 that borrows features from C, sed, awk, shell scripting (sh), and (to a lesser extent) from many other programming languages. Rationale Perl...
Perl, Python is an interpreted, interactive programming language created by Guido van Rossum in 1990, originally as a scripting language for Amoeba OS capable of making system calls. Python is often compared to Tcl, Perl, Scheme, Java, and Ruby. Python is developed as an open source project, managed by the non...
Python and PyObjC. For Economics and commerce define an end-user as the person who uses a product. The end-user may differ from the customer, who might buy the product, but doesnt necessarily use it; for example, with baby clothes, a parent might purchase garments as a customer for an end-user...
end-users, Cocoa Application has the following meanings: In general, an application is using something general to some more conrete. For example: applied science. In business, an application is call for a job. In computing, application refers to a a software application. See also: application server This is a disambiguation page — a...
applications are considered to be those written using the Cocoa programming environment. Such applications usually have a distinctive feel, since the Cocoa programming environment automates many aspects of an application to comply with Apple's Human User Interface guidelines. Cocoa history
Cocoa is derived from the NeXTSTEP Desktop NeXTSTEP is the original object-oriented, multitasking operating system that NeXT Computer, Inc. developed to run on its proprietary NeXT computers (informally known as black boxes). NeXTSTEP 1.0 was released on 18 September 1989 after several previews starting in 1986, and the last release 3.3 in...
NeXTSTEP and OpenStep is an open object-oriented API specification for an object-oriented operating system that uses any modern operating system as its core, principly developed by NeXT. It is important to recognize that while OpenStep is an API specification, OPENSTEP (all capitalized) is a specific implementation of this OpenStep developed...
OPENSTEP programming environments developed by Next can refer to: what comes after this one — see Next a 1977 album named Next by Journey. a 2002 album named Next by Soulive. an acronym for electromagnetic interference called Near End Crosstalk. NeXT computer company (defunct) A British clothes retailer, Next Next Media, a pro-democracy publishing...
NeXT in the late 1980s. Apple acquired NeXT in December, 1996 is a leap year starting on Monday of the Gregorian calendar, and was designated the International Year for the Eradication of Poverty. Events Environmental change The invasive species Asian long-horned beetle is found in New York January 7 - One of the worst blizzards in American history hits eastern...
1996, and subsequently went to work on the Art and literature In music, a rhapsody is an enthusiastic instrumental composition of indefinite form. In poetry, a rhapsody is an epic poem, or part of one, that is suitable for recitation at one time, such as a book of Homers Odyssey. Generally, a rhapsody is an effusion, such...
Rhapsody operating system that was supposed to be the direct successor of OPENSTEP and use OPENSTEP technology proper, and have an emulation base for Mac OS, which stands for Macintosh Operating System, is Apple Computer’s name for the operating systems for Macintosh computers. The original Mac OS was the first commercially successful operating system which used a graphical user interface. The Macintosh team included Bill Atkinson, Jef Raskin and Andy...
Mac OS applications, which was termed Blue Box. The OPENSTEP base of libraries and binary support was termed Yellow Box. Rhapsody evolved into Mac OS X, and the Yellow Box became Cocoa. Much of the work that went into developing OPENSTEP was applied to the development of Mac OS X. Cocoa is the most visible part of that Synergy or synergism, most often refers to the phenomenon of two or more discrete influences or agents acting in common to create an effect which is greater than the sum of the effects each is able to create independently. Synergy has origins as a theological term describing the cooperation of...
synergy. There are, however, some important fundamental differences. The most visible of which is that NeXTSTEP and OPENSTEP used NeXT Computer Inc. designed Display PostScript (or DPS) as a display system for their series of Unix-based personal computers starting around 1987. Display PostScript was developed with (or given to) Adobe, and made an official Adobe product with its own standards documents and licensing requirements. As the name implies...
Display PostScript for on-screen display of text and graphics, while Cocoa depends on Apple's Quartz is the graphics layer that sits on top of the Darwin core of Mac OS X, sometimes also referred to as CoreGraphics. Quartz directly supports Aqua by displaying two-dimensional graphics to create the user interface, including on-the-fly rendering and anti-aliasing with sub-pixel precision. There...
Quartz (which uses Portable Document Format (PDF) is a file format developed by Adobe Systems for representing documents in a manner that is independent of the original application software, hardware, and operating system used to create those documents. A PDF file can describe documents containing any combination of text, graphics, and images in...
PDF). Cocoa also has a level of internet support, including the NSURL and WebKit In computing, HyperText Markup Language (HTML) is a markup language designed for the creation of web pages and other information viewable in a browser. The focus of HTML is on the presentation of information—paragraphs, fonts, italics, tables, and so forth—rather than the semantics—what the...
HTML classes, and others, while under OPENSTEP there was only rudimentary support for managed network connections through NSFileHandle classes and The Berkeley sockets application programming interface (API) comprises a library for developing applications written in the C programming language that access a computer network. Berkeley sockets (also known as the BSD socket API) originated with the 4.2BSD system (released in 1983) as an API, covered under the BSD license...
Berkeley sockets. Prior to its current use, the "Cocoa" trademark was the name of an application that allowed children to create multimedia projects. It was originally known as KidSim, and is now licensed to a third party and marketed as Stagecast. The program was discontinued as part of the In psychology, rationalization is the process of constructing a logical justification for a decision that was originally arrived at through a different mental process. This process can be in a range from fully conscious (e.g. to present an external defense against ridicule from others) to mostly subconscious (e.g...
rationalizations following Steve Jobs Steven Paul Jobs (born February 24, 1955) is best known as the co-founder (with Steve Wozniak) and CEO of Apple Computer, and somewhat less so for his leadership of Pixar. He is also regarded as a pioneer in computing for the incredibly successful Apple II computer, and...
Steve Jobs' return to the company.
Memory management One feature of the Cocoa environment that is certainly unusual, if not unique, is its facility for managing dynamically allocated memory. Cocoa's NSObject class, from which most classes, both vendor and user, are derived, implements a reference counting scheme for memory management. Objects derived from the NSObject root class respond to a retain and a release messages, and keeps a retain count, which can be queried by sending a retainCount message. A newly allocated object, created with alloc, has a retain count of one. Sending that object a retain message increments the retain count, while sending it a release message decrements the retain count. When an object's retain count reaches zero, it is deallocated and its memory is freed. (Deallocation is to Objective C objects as destruction is to C++ objects. The dealloc method is functionally equivalent to a C++ destructor.) In addition to manual In computer science, reference counting is a technique of storing the number of references, pointers or handles to a resource such as an object or block of memory. Use in garbage collection Reference counting is often known as a garbage collection algorithm where each object contains a count of the...
reference counting, application programmers may choose to make use of autorelease pools. Sending an object an autorelease message registers a future release message with that thread's global autorelease pool. When the autorelease pool is deallocated, it sends the corresponding release message for every registered autorelease. Autorelease pools are generally deallocated and re-created at the end of the program's event loop, guaranteeing program flow has passed out of the block where that object was autoreleased. This means the application has predicatable performance and memory collection is generally invisible to the user, whereas under most fully automated schemes the application will sometimes suddenly stop responding when the garbage collection system is started. Cocoa gives the programmer the choice of whether to manually manage Memory management is the act of managing computer memory. In its simpler forms this involves providing ways to allocate portions of memory to programs at their request and free it back to the system for reuse when no longer needed. Virtual memory systems increase the effectively available amount of RAM...
memory management of objects or not. Opinions on this are divided. Some say that Cocoa's memory management is superior because it allows the programmer to have precise control over when his objects are deallocated, but does not burden him with the necessity of doing so for every object a program allocates, nor incurs the performance penalty that usually goes with automatic garbage collection. Others say that the entire scheme is unnecessary, and that Java-style automatic In computing, garbage collection is a system of automatic memory management which seeks to reclaim memory used by objects which will never be referenced in the future. It is commonly abbreviated as GC. The part of a system which performs garbage collection is called a garbage collector. When a system...
garbage collection is superior, because it removes the possibility of programmer error in memory management. A combination of the two features is also possible. Modern garbage collectors often include features to be started and stopped mid-task, allowing the application to control how much time will be taken up whenever the system is called. Combining such a system with AppKit's "do it in the event loop" appears to offer a best-of-both-worlds solution. Such a system was successfully implemented under GNUstep is a free software implementation of NeXTs OpenStep Objective-C libraries (called frameworks), widget toolkit, and application development tools not only for Unix-like operating systems, but also for Microsoft Windows. It is part of the GNU project. GNUstep features a cross-platform, object-oriented development environment based...
GNUStep, For the GNUs Not Unix computing project, see GNU. Species Connochaetes taurinus Connochaetes gnou Reference: The Columbia Encyclopedia The wildebeest (from Dutch wild animal), also called gnu (pronounced noo, or nyoo), is a large hooved (ungulate) mammal of the genus Connochaetes, which includes two species, both native to Africa...
GNU's Open source refers to projects that are open to the public and which draw on other projects that are freely available to the general public. Openness, open content, and communal are other related topics. This article deals mostly with computer software. Open source or open-source software (OSS) is any...
open source analog of OpenStep.
Main frameworks Cocoa consists primarily of two Objective-C, often referred to as ObjC or more seldomly as Objective C or Obj-C, is an object oriented programming language implemented as an extension to C. It is used primarily on Mac OS X and GNUstep, two environments based on the OpenStep standard, and is the primary language...
Objective-C object libraries called frameworks. This is an article referring to the software development term Framework. For the software suite of the same name please refer to Framework (software suite). In software development, a Framework is a defined support structure in which another software project can be organised and developed. Typically, a framework may include...
Frameworks are a construct unique to the NeXTSTEP/OpenStep/Cocoa family of programming environments. They are functionally similar to In computer science, a library is a collection of subprograms used to develop software. Libraries are distinguished from executables in that they are not independent programs; rather, they are helper code that provides services to some other independent program. Today the vast majority of the code that executes in a...
shared libraries, a compiled object that can be dynamically loaded into a program's address space at run-time, but frameworks add associated resources, header files, and documentation. Cocoa also includes a powerful versioning system to prevent the sort of problems that occur under Microsoft Windows is a range of commercial operating environments for personal computers. The range was first introduced by Microsoft in 1985 and eventually has come to dominate the world personal computer market. All recent versions of Windows are fully-fledged operating systems. Windows was developed for IBM PC compatible computers...
Microsoft Windows, DLL hell is a colorful term given to any problem based on a difficulty in managing Dynamically Linked Libraries (DLLs) installed on a particular copy of an operating system. This includes conflicts between various versions of these libraries, difficulty in obtaining a large number of such libraries, and/or having...
DLL Hell. - Application Kit or AppKit is directly descended from the original NeXTSTEP Application Kit. It contains code with which programs can create and interact with A graphical user interface (or GUI, pronounced gooey) is a method of interacting with a computer through a metaphor of direct manipulation of graphical images and widgets in addition to text. GUIs and PUIs The precursor to GUIs was invented by researchers at the Stanford Research Institute (led by Doug...
graphical user interfaces. NSWindow and NSButton are examples of AppKit classes.
- The Foundation Kit, or just Foundation for short, is a framework specified under the OpenStep specification. Foundation specifies device independent classes and programming functionality. There are several classes specified by Foundation, these are: (outlining represents inheritance structure) NSObject NSArray NSMutableArray NSAssertionHandler NSAttributedString NSMutableAttributedString NSAutoreleasePool NSBundle NSCharacterSet NSCoder NSArchiver NSUnarchiver NSPortCoder...
Foundation Kit, or more commonly simply Foundation, first appeared in OpenStep. Foundation is a generic object-oriented library providing Generally, string is a thin piece of fiber which is used to tie, bind, or hang other objects. String can be made from a variety of fibres. You can get different kinds, twine for example. The term has more specific meanings, within certain academic disciplines. Biology In biology, a string...
string and value Anatomy In the context of joints, manipulation is the forceful, passive movement of a joint beyond its active range of motion. Manipulation does not imply specificity or the correction of the vertebral subluxation, and therefore is not synonymous with the chiropractic adjustment. Social psychology In a psychological context, manipulation means...
manipulation, Containers in the port of Kotka (Finland) on the Baltic Sea. Containerization is a system of intermodal cargo transport using standard ISO containers that can be loaded on container ships, railroad cars, and trucks. There are three common standard lengths, 20 ft (6.1 m), 40 ft (12.2 m...
containers and Iteration is the repetition of a process, typically within a computer program. Confusingly, it can be used both as a general term, synonymous with repetition, and to describe a specific form of repetition with a mutable state. When used in the first sense, recursion is an example of iteration. However...
iteration, This article or section should include material from Distributed programming This article or section should include material from Distributed system Distributed computing is the process of aggregating the power of several computing entities to collaboratively run a single computational task in a transparent and coherent way, so that they appear...
distributed computing, event handling, and other functions that are not directly tied to the graphical user interface. NSString, NSDictionary and NSURLHandle are examples of Foundation classes.
The "NS" prefix, used for all framework objects, comes from Cocoa's NeXTSTEP/OpenStep heritage, as does the .nib A filename extension or filename suffix is an extra set of (usually) alphanumeric characters that is appended to the end of a filename to allow computer users (as well as various pieces of software on the computer system) to quickly determine the type of data stored in the file. It...
file extension used by the Interface Builder. The .nib suffix originally stood for NeXT Interface Builder, but conventional wisdom now holds that .nib doesn't stand for anything; it is now said to refer to the word A fountain pen is a writing instrument, more specifically a pen, that contains a reservoir of water-based ink that is fed to a nib through a feed via a combination of gravity and capillary action. Refilling ink either involves replacing an ink cartridge, filling the pen with an eyedropper...
nib, meaning the sharpened point of a quill or pen. A key part of the Cocoa architecture is its comprehensive views model. This is organised along conventional lines for an application framework, but is based on the Portable Document Format (PDF) is a file format developed by Adobe Systems for representing documents in a manner that is independent of the original application software, hardware, and operating system used to create those documents. A PDF file can describe documents containing any combination of text, graphics, and images in...
PDF drawing model provided by Quartz is the graphics layer that sits on top of the Darwin core of Mac OS X, sometimes also referred to as CoreGraphics. Quartz directly supports Aqua by displaying two-dimensional graphics to create the user interface, including on-the-fly rendering and anti-aliasing with sub-pixel precision. There...
Quartz. This allows creation of custom drawing content using For information about the PostScript page description language, see PostScript. A postscript (from post scriptum, a Latin expression meaning after writing and abbreviated P.S.) is a sentence, paragraph, or occasionally many paragraphs added, often hastily and incidentally, after the signature of a letter or (sometimes) the main body of...
PostScript-like drawing commands, which also allow automatic printer support and so forth. Since the Cocoa framework manages all the clipping, scrolling, scaling and other chores of drawing graphics, the programmer is freed from implementing basic infrastructure and can concentrate only on the unique aspects of an application's content.
Model, View, Controller After many years of trial and error, the Smalltalk is a dynamically typed object oriented programming language designed at Xerox PARC by Alan Kay, Dan Ingalls, Ted Kaehler, Adele Goldberg, and others during the 1970s. The language was generally released as Smalltalk-80 and has been widely used since. Smalltalk is in continuing active development, and has gathered...
Smalltalk teams at Xerox Palo Alto Research Center (PARC) was a flagship research division of the Xerox Corporation, based in Palo Alto, California, USA. It was founded in 1970 and spun out as a separate company in 2002. PARCs founding director, George Pake, was an outstanding physicist in the area of nuclear...
Xerox PARC eventually settled on a design philosophy that led to easy development and high code reuse. Known as This article or section should include material from Model view controller triad Model-View-Controller (MVC) is a software architecture that separates an applications data model, user interface, and control logic into three distinct components so that modifications to the view component can be made with minimal impact to...
Model-view-controller, or MVC, the concept breaks an application into three sets of interacting object classes. The Models represent templates for the types of data a program will manipulate. Models might include Person or Vehicle, or more common examples like text file. On the "other end" of the system are the Views, which are responsible for the graphical display of the application. Views include not only the obvious examples such as Window or TextField, but also the application and event system as a whole. That is, the View represents the entire running GUI. In the middle, and vital to the concept, are the controllers. Controllers translate the "commands" coming from the GUI into operations on the Models that they are editing. The controllers are also responsible for translating data in the models into a format useful for the View to use. Controllers allow the data (models) or look-and-feel (view) to be changed dramatically with little or no changes to the other layers. For instance, modifying a text-file based database application to use a SQL database instead requires only the models to be changed; the view can remain entirely unchanged, while the controller is likely to need little or no changes. It is this middle layer of controllers that is missing from most An application framework is a term usually used to refer to a set of libraries or Class-(object_oriented-programming) that are used to implement the standard structure of an application for a specific operating system. By bundling a large amount of reusable code into a framework, much time is saved...
application frameworks. MacApp was Apple Computers primary object oriented application framework for the Mac OS for much of the 1990s. First released in 1985, it is arguably the first such system to be widely used, notably on a microcomputer platform. Microsofts MFC and Borlands OWL were both based directly...
MacApp and Microsoft Foundation Classes, or MFC, is a Microsoft library that wraps portions of the Windows API in C++ classes, forming an application framework. Classes are defined for many of the handle-managed Windows objects and also for predefined windows and common controls. MFC was introduced in 1992 with Microsofts...
Microsoft Foundation Classes, for instance, lack this layer. Invariably applications written in these systems "export" information about the data directly into the GUI, and vice versa. Changes to either often require extensive changes to the entire program. That is not to say that one cannot write an MVC application using these frameworks, and many do, but the difference is that you actively have to try hard to write a "bad" program in Cocoa. In more recent versions of Cocoa, those shipping with OS X 10.3 and later, Apple has started to provide pre-rolled controller objects. For instance, one common type of controller mediates access between a preferences control panel (Options in Windows-ese) and the preferences file stored on disk. The name and location of this file is well defined, as are the actions carried out on them, the only differences are the exact data stored in the file. Apple now includes a controller object for this task, one that stores a list of the data elements in the file, and handles all the modifications to them. Developers need only decide what to put in the file, and then wire up the control panel GUI to call the pre-rolled methods in the controller, something that takes a few minutes at most. To date the number of controller objects has remained fairly limited -- there's no generic "document controller" for instance. Still, considering this layer is often missing entirely, it is a welcome addition to the system.
Invocations and bindings In most object oriented languages, calls to methods are represented physically by a pointer to the code in memory. Since languages, like C++ (pronounced see plus plus) is a general-purpose computer programming language. It is a statically typed free-form multi-paradigm language supporting procedural programming, data abstraction, object-oriented programming, and generic programming. During the 1990s, C++ became one of the most popular commercial programming languages. Bell Labs Bjarne Stroustrup...
C++, demand that the functions be known at compile time, this presents a problem when trying to build a GUI; commands issued by widgets such as buttons or menu items must call a function, but that function belongs to an unknown class -- the correct "responder" to a message changes as the user switches windows, for instance. Most systems have responded to this problem by having a layer of intermediate objects known as "commanders", which are in some ways similar to mini-controllers. Commanders are written for each possible GUI action, and know how to examine the application's state to decide what function to call on what object. For instance, a Cut commander would be able to decide what document the action should be applied to by looking at the list of open windows. Under Objective-C calls are represented instead by an invocation, essentially a string describing the call to be made. When a call is made, the invocation is sent into the ObjC runtime, matched against a list of possible methods, and then called. Since the invocation is text data, this allows it to be saved to a file, transmitted over a network, or manipulated in other ways. The Cocoa GUI builder, Interface Builder (IB), makes extensive use of this facility. Under Cocoa there are no Commander objects, instead the actual method call is stored, as an invocation, directly in the application's resource file. Following our example above, the Cut menu item itself would contain data saying "call the cut method on the controller". When the application is loaded from disk these strings are turned back into commander-like objects automatically, with no developer effort at all. This can dramatically simplify the process of writing an application's GUI. The system also allows direct access to values in the controller objects to populate the GUI. For instance, a text field can be "bound" to an instance variable in the controller object for a view, that value will automatically appear in the text field, and changes to the field will automatically be copied back into the controller. Cocoa uses a fairly flexible system for finding the right method to call. For instance, if a field is bound to "something", when the field attempts to draw itself it will attempt to find a method called "getSomething", "something", and finally a variable called "something" as well. The ObjC runtime makes this series of calls essentially invisible and free. Another recent addition to the Cocoa system is the idea of "bindings". Bindings are an expanded version of the original Cocoa value-lookup system, automating the process of moving changes between the GUI and data. Previously the developer had to write code in the controller to notice these changes, either by asking the model objects or seeing that the GUI had called one of the controller's data methods, and then move that change into the GUI or model respectively. This "glue code" often represented the vast majority of an application's code. Oddly the Cocoa system has always included a system for "noticing" such changes for the cost of a single method call. Once registered, changes to objects would automatically call the appropriate code for moving the data. Under the latest versions of Cocoa this process has been completely automated. By attaching data to a GUI object via the "bindings" instead of the traditional "value", the system registers that value for watching when the application is started. From then on, any changes in the GUI are automatically reflected back onto the models, and likewise, changes to the model generate notifications which cause the GUI to update itself. Using bindings the amount of code, and storage, in the controller objects falls dramatically. Controllers are reduced to housekeeping tasks; setting up the state of the form when it is opened, and collecting model objects to start off the display.
Rich objects One of the most striking features of Cocoa, aside from the development aspects themselves, are the powerful "base objects" the system supplies. As an example, consider the NSString class in Foundation, and the NSText system that manipulates it in the GUI. Almost all application frameworks base their string class on a minor expansion of the language's own strings -- for instance, almost all system use the C++ "char array" as their basis for strings. This leads to excellent performance and easy re-use within C++ libraries, but it also severely constrains the amount of functionality the system has. For instance, char arrays are not able to handle In computing, Unicode is the international standard whose goal is to provide the means to encode the text of every document people want to store in computers. This includes all scripts still in active use today, many scripts known only by scholars, and symbols which do not strictly represent scripts...
Unicode strings and other common problems, which led developer teams to introduce new string classes into their systems, greatly confusing the API. In contrast, NSString is perhaps the most powerful string object you could imagine. It fully supports not only ASCII and Unicode, but practically any known encoding, supporting development with a huge library of manipulation commands. Oddly the only obvious missing feature of NSString is a This article needs cleanup. Please edit this article to conform to a higher standard of article quality. Regex is an abbreviation of regular expression. Regex is a C regular expression library written by Henry Spencer. Later versions support the POSIX standardized regular expressions. Regex is now found in various places...
regex package, yet here too Cocoa manages to overdeliver, as the ObjC system allows a regex package to be "grafted onto" the existing string class via the use of categories. Perhaps even more impressive is the GUI's object used to display and edit strings, NSText and its associated objects. The collection of objects involved permit the same code to implement anything from a simple single line text entry field to a complete multi-page, multi-column text layout schema, with full professional Typography (from the Greek words typos = form and grapho = write) is the art and technique of selecting and arranging type styles, point sizes, line lengths, line leading, character spacing, and word spacing for typeset applications. These applications can be physical or digital. The two primary functions of typography are the...
typography features such as In typography, kerning is the process of adjusting letter spacing in a proportional font. In a well-kerned font, the two-dimensional blank spaces between each pair of letters all have similar area. The name derives from a cognate of corner. In the days when when all type was cast...
kerning, In writing and typography, a ligature occurs where two or more letterforms are written or printed as a unit. Generally, ligatures replace characters that occur next to each other when they share common components. A letter with an accent mark is not usually called a ligature, though it would require...
ligatures, running text around arbitrary shapes, rotation, and of course full In computing, Unicode is the international standard whose goal is to provide the means to encode the text of every document people want to store in computers. This includes all scripts still in active use today, many scripts known only by scholars, and symbols which do not strictly represent scripts...
unicode support and In digital signal processing, anti-aliasing is the technique of minimizing aliasing when representing a high-resolution signal at a lower resolution. In most cases, anti-aliasing means removing data at too high a frequency to represent. When such data is left in a signal, it causes unpredictable artifacts such...
anti-aliased A glyph is a carved figure or character, incised or in relief; a carved pictograph; hence, a pictograph representing a form originally adopted for sculpture, whether carved or painted. Augustan English scholars of the early 18th century, imitating French antiquaries, adopted glyph from the Greek word meaning a carving. Compare...
glyph rendering. Paragraph layout can be controlled automatically or by the user, using a built-in "ruler" object that can be attached to any view. Spell checking is automatic, using a single universal dictionary used by all applications that uses the "squiggly underlining" introduced by Microsoft. And, as with all Cocoa objects, unlimited Undo/Redo support is built in. Using only the built in features, one can write a text editor application in as few as 13 lines of code. With new controller objects this may fall to zero. For contrast, consider MacApp's solution to the same problem. Strings were based on char arrays, thereby limiting it, effectively, to Roman-based languages (English really). The developers also didn't want to write their own editor for the GUI, so they instead wrote a thin layer over the existing TextEdit controls in the MacOS. This limits the view to a single paragraph style, 32k text maximum, and only the most basic manipulations. Everything else, including complexities like Undo, are left to the developer. Of course this sort of "thin" support is not really useful, so developers are often forced to use 3rd party products to fill in the missing features. Yet even the best of the text views for MacApp come nowhere close to the power of NSText. This is not a slight on MacApp by any means, almost all application frameworks use similar "built in" controls intended for display of small strings only -- the same is true of MFC for instance. Generally Cocoa classes tend to be some of the richest and most powerful out-of-the-box objects available. Customization of the system takes place, as it does on all systems, but in a typical application the amount of code dedicated to "fixing" the base classes is likely to be a very small amount compared to other frameworks, such as MacApp was Apple Computers primary object oriented application framework for the Mac OS for much of the 1990s. First released in 1985, it is arguably the first such system to be widely used, notably on a microcomputer platform. Microsofts MFC and Borlands OWL were both based directly...
MacApp. For instance, under MacApp the basic text editing control is based on TextEdit, a control built into the MacOS from the earliest days that even Apple states should not be used for any "real world" applications. Thus, if one were to write a word processor using MacApp, the entire text handling system has to be written from scratch (although there are commercial alternatives). The same contrasts can be found throughout the Cocoa system with few exceptions; the table, window, clipboard handling etc. are all "best of breed". Even when extensions are needed, which is "always" in practical settings, Cocoa's use of Objective-C makes this a much easier task. ObjC includes the concept of "categories" which allow code to be added onto existing classes at runtime. Adding functionality to the text system, say for This article needs cleanup. Please edit this article to conform to a higher standard of article quality. Regex is an abbreviation of regular expression. Regex is a C regular expression library written by Henry Spencer. Later versions support the POSIX standardized regular expressions. Regex is now found in various places...
regex, can be accomplished in a category without any changes to the original classes in the framework, or even access to its source. All text handling in the application will now support the new functionality. Under more common frameworks this same task would require the programmer to make a new subclass supporting the additional features, and then change all instances of the text classes to this new class. This can be very difficult if the application is being build in a GUI-based editor, which often won't allow you to easily place your own objects into the system in place of the system-supplied ones.
Rapid application development Readers familiar with Rapid application development (RAD), is a software programming technique that allows quick development of software applications. Some RAD implementations include visual tools for development and others generate software frameworks through tools known as wizards. While RAD tools significantly cut down in software development time, they sometimes do it while sacrificing...
rapid application development (RAD) systems, like Visual Basic (VB) is an event driven programming language and associated development environment, created by Microsoft. It is derived heavily from BASIC. VB enables Rapid Application Development (RAD) of graphical user interface (GUI) applications; allows easy access to databases using DAO, RDO, or ADO; and makes it easy to create...
Visual Basic or Delphi is a programming language and software development environment. It is produced by Borland (known for a time as Inprise). The Delphi language, formerly known as Object Pascal (Pascal with object_oriented extensions) originally targeted only Microsoft Windows, but now builds native applications for Linux and the Microsoft .NET framework as...
Borland Delphi, may be struck by some of the parallels between their systems and Cocoa. Both offer easy access to the data in the display's controls, allowing it to be manipulated directly in the code without having to write any sort of controllers to mediate. Indeed, one of the hallmarks of a RAD system is that they allow you to access the GUI state directly and very easily, and the data is generally "typeless" (Variant under VB), allowing the code to be rather simplified. Another common feature of RAD systems is a tight integration between the GUI editor and the code supporting it. For instance, Microsoft Access is a database management system from Microsoft, packaged with Microsoft Office Professional which combines the Jet relational database engine with a graphical interface intended to make it possible for relatively unskilled programmers and non-programmer power users to build front ends to databases. For skilled developers and data...
Microsoft Access allows the developer to lay out the GUI in the forms editor, connect the various controls to the database fields they represent, and then attach "event handlers" to controls to call code. That code can then be edited simply by clicking on a button, which opens the code editor and moves to the right spot, or alternately creates an empty block of code if it has not yet been written. The code page is the controller, and the database, accessed via the form itself, is the model. Commander objects, as in Cocoa, are being handled invisibly; at runtime the system will look in the attached code (controller) for a method with the name "theControlName_theEvent", for instance "MyButton_click". The same application written in Cocoa is somewhat more complex. For one, the tight integration between the GUI editor and code from Visual Basic is simply not as well developed under XCode -- although, oddly, it was in earlier versions of the NeXT development system. Although the general procedure of attaching event handlers to the GUI controls is the same, the environment makes the process of moving from code to GUI more complex. Another difference is that Cocoa does not (yet) include a system for database access, but this is perhaps not too surprising: Access is a database front-end, it was designed with this purpose in mind. To create such a project in Cocoa, a controller object must be written to mediate access to the database and retreive records as the GUI requests them. The rest of the code is similar, bindings make the data flow to and from the GUI's form, and the controller object isolates all the code used by the form in question. There are, however, some interesting points that need to be considered. For one, the Cocoa application is written entirely in complied C code, and generally runs much faster than the same program in Visual Basic. Most of the code is actually in the frameworks themselves, which are already loaded up by the operating system, meaning that the program is very small and loads very quickly. Another difference is the power of the objects used in the GUI, although for a forms processing application these features may not be needed. But the true difference lies in the flexbility of the two systems. Note that the Access version has bound the data directly into the GUI at several levels; changes to the underlying data model in the database will often require the developer to re-write huge portions of the GUI. Under Cocoa, these changes are isolated in the model objects, which can be easily modified to make the change invisible -- it makes no difference to the GUI if the model uses a SQL database or a text file for storage, and the model can change between those two without the GUI ever knowing. This is where the MVC model makes systems more maintainable, changes, even radical ones, are isolated to well known locations. Finally, it is important to note that the controller in this case is not simply a file full of code, but a full-blown object. This means that multiple forms can all share the same controller object -- both as a way to allow multiple windows (forms) to display different parts of the same data, or alternately, to allow a number of similar forms to place their shared code in a single place. Consider the task of making a "largely similar" form in VB, which would require the developer to cut and past the code between the two forms, or isolate that code into a "module" and re-write both forms to call the module. Under Cocoa the developer would simply point, in IB, both forms at the same controller. It is also worth noting that Apple is aware of the difficulty in accessing databases. One of NeXT's major products was Enterprise Objects Framework (or more commonly, EOF) is an object-relational mapping product which is currently included in the WebObjects product sold by Apple, although it was originally created by NeXT for use on NeXTSTEP and OpenStep and sold as a separate product. EOF evolved from an lower level toolkit...
Enterprise Objects Framework (EOF), a library of code that provided pre-rolled models and controllers for database applications. Using EOF database applications were almost as easy to write as under dedicated RAD systems like Access, the main differences being the less-than-tight integration between the various parts of the development enviornment. EOF has since, largely, been adbandoned. In its place Apple is introducing Core Data, a new set of lighter-weight objects intended to work hand-in-hand with bindings. Currently the Core Data system intends to support The eXtensible Markup Language (XML) is a W3C recommendation for creating special-purpose markup languages. It is a simplified subset of SGML, capable of describing many different kinds of data. Its primary purpose is to facilitate the sharing of structured text and information across the Internet. Languages based on XML...
XML and simple binary files, as well as SQLite is an ACID-compliant relational database management system contained in a relatively small C library. It is a public domain project created by D. Richard Hipp. Unlike the usual client-server paradigm, the SQLite engine is not a standalone process with which the program communicates, but is linked in...
SQLite databases. EOF's "high-end" database integration is not currently being addressed, although the Core Data system could be expanded in that direction in the future. Cocoa fits an interesting niche in development. It provides objects and a programming model that allows "full blown" applications to be developed, like those using MacApp or MFC, but to do so for considerably less effort -- developers generally claim 1/10th to 1/100th the code, with greater difference for simpler apps -- that is, simpler apps are far easier to write under Cocoa. Complex apps are complex, and the amount of savings due to the powerful GUI system may represent only a small amount of the code in total. At the same time Cocoa can almost claim to be a RAD as well. The model makes development and modification of existing systems much easier than traditional development platforms, although not quite as easy as under systems such as Visual Basic. The majority of the difference is due to the development enviornment, not the programming model, and it appears Apple is at least interested in closing the loop on database access through Core Data.
Implementations The Cocoa frameworks are written in Objective-C, and hence Objective-C is presently the preferred language for the Cocoa applications. Java In computer science, binding refers to the creation of a simple reference to something which is larger and more complicated and used frequently. The simple reference can be used instead of having to repeat the larger thing. Some common examples of binding are: Name binding in programming languages. Command binding...
bindings for the Cocoa frameworks are also available, but do not appear to have seen much real-world use. AppleScript Studio, part of Apple's Xcode Tools makes it possible to write (less complex) Cocoa applications using AppleScript is a scripting language devised by Apple Computer, and built into Mac OS. More generally, AppleScript is the word used to designate the Mac OS scripting interface, which is meant to operate in parallel with the graphical user interface. History The AppleScript project was an outgrowth of the HyperCard...
AppleScript. Third party bindings are also available for other languages: - Python is an interpreted, interactive programming language created by Guido van Rossum in 1990, originally as a scripting language for Amoeba OS capable of making system calls. Python is often compared to Tcl, Perl, Scheme, Java, and Ruby. Python is developed as an open source project, managed by the non...
Python - PyObjC (http://pyobjc.sourceforge.net)
- Ruby is an object-oriented programming language. It combines syntax inspired by Ada and Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp and CLU. It was originally designed as an interpreted language, though in its JRuby implementation it may be compiled. History The...
Ruby - RubyCocoa (http://www.fobj.com/rubycocoa/)
- Programming Republic of Perl logo Perl, also Practical Extraction and Report Language (a backronym, see below), is a programming language released by Larry Wall on December 18, 1987 that borrows features from C, sed, awk, shell scripting (sh), and (to a lesser extent) from many other programming languages. Rationale Perl...
Perl - CamelBones (http://camelbones.sourceforge.net)
- C# (pronounced see-sharp) is an object-oriented programming language developed by Microsoft as part of their .NET initiative. Microsoft based C# on C++ and the Java programming language. C# was designed to balance power (the C++ influence) with rapid development (the Visual Basic, Delphi programming language, and Java influences...
C# - Cocoa# (http://www.cocoasharp.org/)
A more extensive list of implementations (http://www.fscript.org/links.htm) is available.
External links |