• 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
generics fun
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

generics fun


  • Subject: generics fun
  • From: Lachlan Deck <email@hidden>
  • Date: Tue, 22 Jul 2008 07:13:12 +1000

Hi there,

one of the things that frustrates me about generics is working with collections. So I have a framework which has some stuff that deals with the abstract entity types (with these entity types being subclassed in the relevant application).

This leads to stupid stuff like this:
public class Thing {
	public void addAll( NSArray<AbstractType> foo );
	...
}

And in the application:
NSArray<ConcreteType> bar;// assume exists

thing.addAll( bar ); // -- complains to be not compatible and casting fails

I can change addAll to take <? extends AbstractType> but then other stuff fails and so on. How are others dealing with this stuff?

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


  • Follow-Ups:
    • Re: generics fun
      • From: "Shkutkov Michael" <email@hidden>
    • Re: generics fun
      • From: Guido Neitzer <email@hidden>
  • Prev by Date: Re: Problem with webobjects - tag occurred before another tag
  • Next by Date: Re: Command line argument to reformat .wo components template
  • Previous by thread: Re: Problem with webobjects - tag occurred before another tag
  • Next by thread: Re: generics fun
  • Index(es):
    • Date
    • Thread