• 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
Re: Comparing EOs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing EOs


  • Subject: Re: Comparing EOs
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Wed, 29 Mar 2006 09:34:43 -0500

Hi, Miguel,

On Mar 29, 2006, at 9:04 AM, Miguel Arroz wrote:
Something I could still not figure out from the docs... what is the standard implementation of the "equals" method in EOs? How does WebObjects compare objects if I do not implement the equals method?

The documentation for EOCustomObject says the following:

=========================================
equals - public final boolean equals(Object other)

EOF requires all EOs define equality as (this == other) To compare EOs in different EOEditingContexts, consider instead comparing their EOGlobalIDs with equals()
=========================================


Although the grammar isn't the best, it's pretty clearly saying that if you don't override the equals method, it compares for object equality (that is, it tests whether both the message recipient reference and the argument object reference are references to the same object instance).

The sentence that starts, "To compare EOs in different EOEditingContexts, ...", is simply suggesting a more effective implementation to compare EOs across editing contexts if you care to override the method. The suggestion is a good one, since two EOs from different editing contexts will be different objects, even if they represent the same record from the database. By comparing EOGlobalIDs, you will effectively test whether they represent the same persisted object rather than testing whether they are the same instance of an object.

Regards,
Jerry

--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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: Comparing EOs
      • From: Chuck Hill <email@hidden>
References: 
 >Comparing EOs (From: Miguel Arroz <email@hidden>)

  • Prev by Date: Re: Comparing EOs
  • Next by Date: Re: Pop Up windows in WebObjects - can i do it
  • Previous by thread: Re: Comparing EOs
  • Next by thread: Re: Comparing EOs
  • Index(es):
    • Date
    • Thread