1. Ronald Oussoren
  2. pyobjc


pyobjc / Doc / architecture.html

The branch 'pyobjc-ancient' does not exist.
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
PyObjC Architecture</title>
<meta name="Author" content="Ronald Oussoren" />
<h2>PyObjC Architecture</h2>
<tbody valign="top">
<tr><th >Author:</th>
<td>Ronald Oussoren</td></tr>
<h2><a name="introduction">Introduction</a></h2>
<p>XXX: This documentent is outdated and incomplete.</p>
<p>This document gives a (brief) description of how the PyObjC package is 
<h2><a name="objective-c-classes-and-objects">Objective-C classes and objects</a></h2>
<p>Objective-C classes are represented directly as python classes. This allows
us to implement subclassing of Objective-C classes with the full power that
new-style classes provide.</p>
<p>There is one problem with this though, PyTypeObject does not have space to
store additional information, and is a variable-sized object. This means that
subclasses of PyType_Type cannot add instance variables. We solve this by
storing the additional information in a dictionary indexed by the PyTypeObjects
that represent Objective-C classes.</p>
<p>Objective-C objects are represented by proxy objects that are instances of
the classes described above.</p>
<p>TODO: work out how we'll implement subclasses objects and describe here.</p>
<h2><a name="methods-and-instance-variables">Methods and instance variables</a></h2>
<p>Methods and instance variables are represented as 'descriptor' objects that
are attributes of the PyTypeObject describing a class. This way it is possible
to use the normal python introspection mechanisms to explore an objective-C
<p>There is also a mechanism to call methods that are not part of the advertised
interface of a class. This is needed to support classes like NSProxy that 
forward method invocations to other objects.</p>