|
|
Sample Programs from NeXSTEP 3.3
{\rtf0\ansi{\fonttbl\f2\fswiss Helvetica;\f1\fmodern Ohlfs;}
\paperw12800
\paperh13220
\margl120
\margr100
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b\i0\ulnone\fs36\fc0\cf0 Projects Example
\b0\fs24 \
by Steve Herrick, NeXT EOF Team\
\
\b\fs28 Overview
\f1\b0\fs20 \
\f2\fs24 \
This example shows how to control operations on a many-to-many relationship. The inspector panel uses a pop up to switch between alternate master/detail views for the relationship. Inserts and Deletes can be performed on the master, and Add and Remove operations are permitted on the detail. Add and Remove actually affect entries in an intermediate table, which ties the many-to-many together.\
\
Inserts into the Employee and Project entities use the UniqueKey object to supply integer keys. Instances of UniqueKey object share a separate database channel to insure access for reserving new blocks of keys.\
\
\
\b\fs28\fc1\cf1 Program Organization\
\b0\fs24 \
\b Explanation of the nib file
\b0 \
The File's Owner in the .nib file has been set to EOApplication. This was done by dragging in EOApplication.h and setting the File's Owner class in the inspector. EOApplication is necessary to implement autorelease pools under 3.2. This subclass of Application flushes the autorelease pool each cycle through the event queue. Special handling is used to make modal loops work correctly.\
\
As mentioned in the release notes, the _main file was edited as follows:\
\
\f1 #import <EOApplication.h>\
\
\f2 was changed to\
\
\f1 #import <eointerface/EOApplication.h>
\f2 \
\
Each master/detail view has a two connected controllers. Additionally, a controller is used to provide selection panel choices for addtions to the employees on a project and one for projects for an employee.\
\
\
\
\b Major Classes in the Application
\b0 \
\
\
\pard\tx2880\tx2900\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-2880\li2880\fc1\cf1 Projects A coordination object which is the delegate of the Employee and Project controllers. It is used to remove references in the intermediate table when an Employee or a Project is deleted. It also is the target of the Add and Remove buttons in the detail views. Add causes a selection panel to be populated with additional choices from one of the selection controllers. The Projects objects provides the qualifier for the controller that selects choices that are not already present in the detail view.\
\
\pard\tx2900\tx2900\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-2880\li2880\fc1\cf1 UniqueKey Reserves blocks of unique integer keys for a given entity name. UniqueKey uses a separate channel to insure access to its own unique_key entity. This entity (table) is used to store the maxKey for a given entityName. An instance of UniqueKey reserves a block of keys by incrementing maxKey by the block size. Optimistic locking is used for the update, so a re-try consists of a call to re-fetch the current data, increment maxKey, and attempt another update.\
\pard\tx560\tx1120\tx2060\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\fi-2060\li2060\fc1\cf1 \
\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fc1\cf1 Other Peculiarities\
\b0 This example uses the additional shared libraries libEOInterface_s.a, libEOAccess_s.a, and libFoundation_s.a. Also, Makefile.preamble uses:\
\
\f1 OTHER_LDFLAGS = -all_load\
\f2 \
to force the linking of shared library classes that are referenced at runtime by EOPalette.palette objects.\
\fc0\cf0 \
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fc0\cf0 NOTE for HPPA-Users (EOF Release 1.0 only)\
\b0 \
The Oracle7 adaptor is not available yet for HPPA platforms. You'll need to edit the .eomodel file and replace the Oracle7 string with the Oracle string to use the Oracle6-based adaptor.\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0\cf0 \
\b\fs28\fc1\cf1 DB Scripts\
\
\pard\tx2880\tx2900\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b0\fs24\fi-2880\li2880\fc0\cf0 installPEOPLE.sqlsybase\
installPEOPLE.sqloracle Used to create and restore the databases for the Sybase and Oracle versions of this example.\
See PeopleDBScripts directory.\
\b\fs28\fc1\cf1 \
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\b0\fs24\fc1\cf1 Valid for NEXTSTEP Release 3.2 installed with the Enterprise Objects Framework Release 1.0 and 1.1
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.