Re: WO5.4: Generics for objectsWithFetchSpecification ???
Re: WO5.4: Generics for objectsWithFetchSpecification ???
- Subject: Re: WO5.4: Generics for objectsWithFetchSpecification ???
- From: "John Huss" <email@hidden>
- Date: Mon, 14 Jan 2008 09:18:41 -0600
Couldn't you handle both raw rows and EOs by using the type NSArray<NSKeyValueCodingAdditions>?
I treat things this way and casting to a more specific EO class may not be necessary.
John
On Jan 13, 2008 10:03 PM, Lachlan Deck <
email@hidden> wrote:
On 14/01/2008, at 2:13 PM, Mr. Pierre Frisch wrote:
> I am still worried about breaking code.
Sure. Good concern.
> I was more looking along the lines of adding a method like:
> public NSArray<EOEnterpriseObject>
> _enterpriseObjectsWithFetchSpecification(EOFetchSpecification
> fetchSpecification, EOEditingContext context)
> This method raises an exception at run time if the fetch
> specification is raw.
> I am not sure if this should be a public method it adds to the API
> and is not absolutely required.
The problem here is that <EOEnterpriseObject> doesn't take it's type
from anything and so can't be cast to some subtype without
suppressing warnings. So what purpose would it serve?
It seems to me that EOFetchSpecification needs to be genericised or
this whole thing won't be pretty.
> Any comments?
So, to ensure backwards api compatibility how's about this?
@deprecated
public NSArray objectsWithFetchSpecification(EOFetchSpecification
fetchSpec) {...}
public NSArray<T> enterpriseObjectsWithFetchSpecification
(EOFetchSpecification<T> fetchSpec) {...}
public NSArray<NSDictionary<String, ?>>
rawObjectsWithFetchSpecification(EOFetchSpecification fetchSpec) {....}
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
This email sent to
email@hidden
_______________________________________________
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