• 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: WO5.4: Generics for objectsWithFetchSpecification ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WO5.4: Generics for objectsWithFetchSpecification ???


  • Subject: Re: WO5.4: Generics for objectsWithFetchSpecification ???
  • From: Lachlan Deck <email@hidden>
  • Date: Thu, 10 Jan 2008 20:06:34 +1100

On 08/01/2008, at 2:36 AM, Mike Schrag wrote:

NSArray<MyEO> = ec.objectsWithFetchSpecification(spec, MyEO.class)
I think generic EOFS would be better ... Passing in Class objects to fulfill generics always feels a bit like hackery. It's really cheating -- you're basically casting without using cast syntax, because you can't enforce that the class you put in is actually related to the objects of the fetch spec in any way, so it's as unsafe as an arbitrary cast.

public <T> NSArray<T> objectsWithFetchSpecification (EOFetchSpecification<T> fetchSpec) { ... }

then

EOFetchSpecification<Person> fetchSpec = ...;
NSArray<Person> people = ec.objectsWithFetchSpecification(fetchSpec);

The other problem this all poses (i.e., using Class objects) is what to do when the particular class object for an entity (e.g., a subclass of the framework's java classes) is determined at runtime via Properties?


Any fetchspecs in the framework, if forced to pass in a class object to either the fetchSpec or otherwise, could cause an error because WO would not have that class registered for any entities in the runtime...

with regards,
--

Lachlan Deck
_______________________________________________
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


References: 
 >WO5.4: Generics for objectsWithFetchSpecification ??? (From: Gaastra Dennis - WO Lists <email@hidden>)
 >Re: WO5.4: Generics for objectsWithFetchSpecification ??? (From: Mike Schrag <email@hidden>)
 >Re: WO5.4: Generics for objectsWithFetchSpecification ??? (From: Anjo Krank <email@hidden>)
 >Re: WO5.4: Generics for objectsWithFetchSpecification ??? (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Webobjects-dev Digest, Vol 5, Issue 39
  • Next by Date: New podcasts and iTunes
  • Previous by thread: Re: WO5.4: Generics for objectsWithFetchSpecification ???
  • Next by thread: Re: WO5.4: Generics for objectsWithFetchSpecification ???
  • Index(es):
    • Date
    • Thread