Rich Objects
One of the most useful features of Cocoa is the powerful "base objects" the system supplies. As an example, consider the Foundation classes NSString and NSAttributedString, which provide Unicode strings, and the NSText system in AppKit, which allows the programmer to place string objects in the GUI.
NSText and its related classes are used to display and edit strings. The collection of objects involved permit an application 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 features such as kerning, ligatures, running text around arbitrary shapes, rotation, full Unicode support and anti-aliased glyph rendering. Paragraph layout can be controlled automatically or by the user, using a built-in "ruler" object that can be attached to any text view. Spell checking is automatic, using a single dictionary used by all applications that uses the "squiggly underlining" convention introduced by Microsoft (actually a dashed red underline in Cocoa). Unlimited Undo/Redo support is built in. Using only the built-in features, one can write a text editor application in as few as 10 lines of code. With new controller objects, this may fall to zero. This is in contrast to the TextEdit APIs found in the earlier Mac OS.
When extensions are needed, Cocoa's use of Objective-C makes this a straightforward task. Objective-C includes the concept of "categories" which allows for modifications to an existing class "in-place". Functionality can be accomplished in a category without any changes to the original classes in the framework, or even access to its source. 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 classes to this new class.
Read more about this topic: Cocoa (API)
Famous quotes containing the words rich and/or objects:
“The bright old day now dawns again; the cry runs through the the land,
In England there shall be dear breadin Ireland, sword and brand;
And poverty, and ignorance, shall swell the rich and grand,
So, rally round the rulers with the gentle iron hand,
Of the fine old English Tory days;
Hail to the coming time!”
—Charles Dickens (18121870)
“Though collecting quotations could be considered as merely an ironic mimetismvictimless collecting, as it were ... in a world that is well on its way to becoming one vast quarry, the collector becomes someone engaged in a pious work of salvage. The course of modern history having already sapped the traditions and shattered the living wholes in which precious objects once found their place, the collector may now in good conscience go about excavating the choicer, more emblematic fragments.”
—Susan Sontag (b. 1933)