🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #4

Re: How to store any objects with DBKit

#4
From: William Shipley
Date: Tue, 27 Oct 1992 13:20
27 lines
1851 bytes
Florian Wolpert writes
> i missing a lot of documentation (and advice) about storing and retrieving
> user-defined objects via DBKit. Implemented is only NXData for RTF and
> NXImage for TIFF. But who knows more about the internal data flow ?
> For example i want to store the contents of a MultiMedia-Object (something
> like the send window of Mail.app) into the Database but i don't know how !
> Maybe i can use NXData in some way but there are no hints in the docu.
> do i missing something ? who knows more about this ? 

Search for "DBFormatInitialization" in Digital Librarian.

Basically, what you'll do is declare your property to be of type "object" in  
DBModeler.app, and enter the name of the class you want it to be in the "Class"  
field.  (For example, say your class is "MultiMediaThing".)

Now, in MultiMediaThing, you must implement two methods which DBKit will call,  
initFromBuffer:ofLength:withFormat:, which will be called when DBKit reads your  
object in and wants you to instantiate it, and  
writeBuffer:ofLength:usingFormat: which will be called when DBKit wants you to  
bundle up your object to be stored in the database.

You can alternatively use archiving to store objects, but don't because it's  
lame and slow.

-William Shipley
The Omni Group
DBKit consulting (and free advice, too)
Technical Details
Message-ID: <1992Oct27.132010.29791@u.washington.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!news.u.washington.edu!news
References: <1992Oct26.165427.6804@ppgfr.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!news.u.washington.edu!news
From: wjs@blorf.omnigroup.com (William Shipley)
Newsgroups: comp.sys.next.programmer
Subject: Re: How to store any objects with DBKit
Message-ID: <1992Oct27.132010.29791@u.washington.edu>
Date: 27 Oct 92 13:20:10 GMT
Article-I.D.: u.1992Oct27.132010.29791
References: <1992Oct26.165427.6804@ppgfr.uucp>
Sender: news@u.washington.edu (USENET News System)
Organization: University of Washington
Lines: 27