Objective-C: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
mNessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 575:
Besides the [[GNU Compiler Collection|GCC]]/[[NeXT]]/[[Apple Computer]] implementation, which added several extensions to the original [[Stepstone]] implementation, there exists another free open-source Objective-C implementation, which implements a slightly different set of extensions: The Portable Object Compiler [http://users.pandora.be/stes/compiler.html] implements, among other things, also [[Smalltalk]]-like blocks for Objective-C.
==
L'implementazione dell'Objective C usa un semplice [[runtime system]] scritto in C che aumenta di poco la dimensione delle applicazioni. Al contrario, la maggior parte dei sistemi object-oriented esistenti quando fu creato (e [[Java (linguaggio)|Java]] tuttora) usava una grossa [[macchina virtuale]] invasiva per l'intero sistema. I programmi scritti in Objective C tendono a non essere troppo più grandi delle dimensioni del loro [[codice oggetto]] e delle librerie (che generalmente non devono essere incluse nel codice distribuito), al contrario ad esempio dei sistemi [[Smalltalk]] dove grandi quantità di memoria sono necessarie semplicemente per aprire una [[finestra]].
Likewise, the language can be implemented on top of existing C compilers (in [[GNU Compiler Collection|GCC]], first as a preprocessor, then as a module) rather than as a new compiler. This allows Objective-C to leverage the huge existing collection of C code, libraries, tools, and mindshare. Existing C libraries — even in object code libraries — can be wrapped in Objective-C [[Adapter pattern|wrappers]] to provide an OO-style interface.<br>
Riga 589:
Unlike [[C++]], Objective-C does not support [[operator overloading]]. Also unlike C++, Objective-C allows an object only to directly inherit from one class (forbidding [[multiple inheritance]]). As Java was influenced by the design of Objective-C, the decision to use single inheritance was carried into Java. Categories and protocols may be used as alternative functionality to multiple inheritance; Java however lacks categories.
===
Oltre alla [[programmazione strutturata]] del C, C++ supporta direttamente la [[programmazione ad oggetti]], la programmazione generica e la [[metaprogrammazione]]. C++ è inoltre corredato di una estesa [[libreria (informatica)|libreria]] standard che include numerose [[ogetto container (informatica)|classi container]]. L'Objective C, invece, aggiunge solo delle caratteristiche [[object-oriented]] al C; esso, nella sua versione più "pura" non offre lo stesso numero di in termini di librerie standard, ma in molti contesti dove viene usato, viene corredato di una libreria sul modello di quella di [[OpenStep]], di [[Cocoa]] o di [[GNUstep]] le quali forniscono funzionalità sinili a quelle offerte dalla libreria standard di C++.
One notable difference is that Objective-C provides runtime support for some [[reflection (computer science)|reflective]] features, whereas C++ adds only a small amount of runtime support to C. In Objective-C, an object can be queried about its own properties, for example whether it will respond to a certain message. In C++ this is not possible without the use of external libraries; however, it is possible to query whether two objects are of the same type (including built-in types) and whether an object is an instance of a given class (or [[superclass (computer science)|superclass]]).
|