ITWissen.info - Tech know how online

Objective-C

The Objective-C language was introduced in1986 by Brad Cox and developed by Stepstone Comp. It is an extension of the programming language C around the substantial concepts of the programming language Smalltalk-80 and is to retain the C-specific characteristics such as efficiency and portability. Thus Objective-C also integrates object-oriented language concepts. Main principle of the programming language is the support of the reusability and expandability of software by so-called software ICs - these are generally usable modules. The language is transformed into normal C code by a precompiler.

Objective-C has the type system defined by the programming language C with the extension by the predefined type id for arbitrary object references. Due to the non-existing type system for classes, these also do not represent user-defined types. The class concept of Objective-C is independent of the type system of the programming language C.

With the inheritance all characteristics are inherited. Methods can be overridden (reimplemented) in derived classes; this is not allowed for attributes.

Since objects all have the same type - there is no type system for classes - no special concept of polymorphism is necessary. An object reference - which is always a variable of type id - can be assigned to objects of any type. The overloading of methods is not possible.

Classes are considered as independent objects so-called factory objects. With the definition of a class can be distinguished therefore between

  • the characteristics of the class (factory variables and factory methods) and
  • the characteristics of the instances of this class(instance variables and instance methods).
can be distinguished.

The attributes of an object are not visible to the outside. The methods of an object define the interface. A distinction of the access rights within the set of the attributes and/or methods is not possible.

Objects have a reference semantics for assignment and comparison, while for the other data types the semantics of the programming language C applies.

Objective-C knows only the user-controlled creation and destruction of objects by calls of the factory method new and/or the instance method free. The runtime system provides automatic memory management to free unreferenced objects.

A significant application found Objective-C in large class libraries.

Informations:
Englisch: Objective-C
Updated at: 04.02.2010
#Words: 363
Links: extension (EXTN), programming language C, Smalltalk, portability, object (O)
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024