• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
in which EO behalf a ValueFactory works?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: in which EO behalf a ValueFactory works?
      • From: Samuel Pelletier <email@hidden>
  • Prev by Date: Weird D2W rule selection
  • Next by Date: Re: Weird D2W rule selection
  • Previous by thread: Re: Weird D2W rule selection
  • Next by thread: Re: in which EO behalf a ValueFactory works?
  • Index(es):
    • Date
    • Thread