• 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
A simplest way to manage relationship?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A simplest way to manage relationship?


  • Subject: A simplest way to manage relationship?
  • From: DevReseune <email@hidden>
  • Date: Sun, 9 Nov 2003 17:22:23 +0100

Hi,

EOF can manage relationship in both side with:
addObjectToBothSidesOfRelationshipWithKey. But, our interface is more
complicated now. This is another solution to manage relationship. It's
the work of the Eclipse group in the EMF project:

http://dev.eclipse.org/viewcvs/indextools.cgi/~checkout~/emf-home/
docs/overview.html

This the example:

The model is:
Book 0..* (books) -------------- 1 (author) Writer

In Book:
public void setAuthor(Writer newAuthor) {
    if (newAuthor != author) {
      if (author != null)
        msgs = ((InternalEObject)author).eInverseRemove(this, ...);
      if (newAuthor != null)
        msgs = ((InternalEObject)newAuthor).eInverseAdd(this, ...);
      msgs = basicSetAuthor(newAuthor);
    }
}

and
public void basicSetAuthor(Writer newAuthor) {
    Writer oldAuthor = author;
    author = newAuthor;
}

It's simple! You only use:
	aBook.setAuthor(anAuthor);
And all the relationship is managed!

So, my question is: why Apple added this way to manage relationship and
not an EMF solution-like? I find the EMF way simplest. And you?

Fridiric
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: A simplest way to manage relationship?
      • From: Anjo Krank <email@hidden>
  • Prev by Date: WebAssistant incompatible with Xcode
  • Next by Date: NSArray is not a NSSet. So why Apple confuse them in EOF?
  • Previous by thread: Re: WebAssistant incompatible with Xcode
  • Next by thread: Re: A simplest way to manage relationship?
  • Index(es):
    • Date
    • Thread