Re: using value conversion/factory to encode objects in blobs
Re: using value conversion/factory to encode objects in blobs
- Subject: Re: using value conversion/factory to encode objects in blobs
- From: Fabian Peters <email@hidden>
- Date: Sat, 25 Feb 2017 18:01:47 +0000
Try "blobDictionary"… ;-)
> Am 25.02.2017 um 17:56 schrieb email@hidden:
>
> Thanks! But... sorry for me being stupid, but where do I find them? Google can't find the former at all suggesting I really wanted “blood dictionary”; as for the latter, there's the opposite problem -- zillions of hits, among which the proper one _might perhaps_ be hidden somewhere...
>
> All the best,
> OC
>
>> On 25. 2. 2017, at 6:32 PM, George Domurot <email@hidden> wrote:
>>
>> Use the Prototype of blodDictionary or mutableDictionary to do the heavy lifting for you.
>>
>> -G
>>
>>
>>> On Feb 25, 2017, at 8:19 AM, email@hidden wrote:
>>>
>>> Hi there,
>>>
>>> this must be WebObjects 101 and I must be blind as a bat, but ... how on earth does one use the value conversion/factory model support to represent e.g., an attribute containing an NSDictionary (or another custom data object) by a BLOB containing archived data?
>>>
>>> Far as I understand the support, I specify the desired EO-side class, plus an instance method to archive it to NSData, plus a class method (in Javaspeak presumably a static one) to initialise an instance from NSData. But... there are no such methods far as I know for most data classes. E.g., I would need something like
>>>
>>> class NSDictionary ... {
>>> static NSDictionary theMethodToBeUsedForValueFactory(NSData data) {
>>> ByteArrayInputStream bis=new ByteArrayInputStream(data.bytes())
>>> ObjectInputStream is=new ObjectInputStream(bis)
>>> return objectInputStream.readObject()
>>> }
>>> NSData theMethodToBeUsedForValueConversion() {
>>> ByteArrayOutputStream bos=new ByteArrayOutputStream();
>>> ObjectOutputStream os=new ObjectOutputStream(bos)
>>> os.writeObject(this)
>>> os.flush()
>>> return new NSData(bos.toByteArray())
>>> }
>>> }
>>>
>>> none of which, far as I know, actually exists. In Objective C the solution would be trivial, I would simply add appropriate methods through a category; but the bloody Java thing has no similar support.
>>>
>>> What am I missing and how does one solve this?
>>>
>>> Thanks a lot,
>>> OC
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden