in which EO behalf a ValueFactory works?
in which EO behalf a ValueFactory works?
- Subject: in which EO behalf a ValueFactory works?
- From: "ocs@ocs" <email@hidden>
- Date: Wed, 22 Aug 2018 19:31:41 +0200
Hi there,
quite unrelated to the other things, I would need to exploit the
ValueFactory/ValueConversion support of EOF to store my own complex values in
BLOBs.
There's a catch though: for a ValueFactory-generated object, I would need to
know which EO it belongs to (so that, iff the object's own internal state
changes, it can change the EO contents appropriately).
Is there any way to do that?
If important, here's the rationale: so far, I have used two distinct
attributes, conceptually like this:
===
class DBSomething extends ERXCustomObject {
NSData attributeBlob() { storedValueForKey("attributeBlob") } // modelled.
Never used directly, but for the cases below
MyCustomObject attribute() { new
MyCustomObject(attributeBlob,this,"attributeBlob") }
}
class MyCustomObject {
MyCustomObject(NSData contents, ERXEnterpriseObject owner, String key) {
... ...
NSData blobRepresentation() { ... ... }
void didChange() { owner.takeStoredValueForKey(blobRepresentation(), key) }
}
===
but it seems to me it would be cleaner if I could defer creation of
MyCustomObject to the ValueFactory, storing the changes to the ValueConversion,
and get rid of the ugly dichotomy of foo and fooBlob, removing fooBlob
completely and seeing only foo (of type MyCustomObject) at the code level.
Thanks and all the best,
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