• 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: Educate me on generics please...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Educate me on generics please...


  • Subject: Re: Educate me on generics please...
  • From: James Cicenia <email@hidden>
  • Date: Wed, 6 Feb 2008 16:57:12 -0600

arrrgh... all this to just prevent runtime class cast problems?!

Well, maybe on my new projects I will use generics, but, to go back to all my legacy code that works? There is no compelling reason.

-j-

On Feb 6, 2008, at 4:35 PM, Chuck Hill wrote:


On Feb 6, 2008, at 2:20 PM, James Cicenia wrote:

Hmmm,

And to think I learned that method of qualifier creation from either a book or Apples own docs years ago.

I think Pierre's point was not that your code is bad, but that Generics don't solve that problem. They prevent runtime class cast problems (mostly). That is a problem that I don't have anywhere often enough to justify the time cost of fiddling with Generics.


Chuck



But mixing the objects in the List was confusing me, which is what Johann said about just using <Object>


-j-

On Feb 6, 2008, at 3:52 PM, Mr. Pierre Frisch wrote:

I completely disagree on this one. Your example is bad as it mixes different type of objects in the List. The point of generics is to catch type cast exception at compile time instead of run time. if you mix objects in the same array then it has no value but this is bad style anyway.

Pierre
--
Pierre Frisch
email@hidden


On Feb 6, 2008, at 12:37, Chuck Hill wrote:


On Feb 6, 2008, at 12:33 PM, James Cicenia wrote:

Well I have decided to to start going to 1.5 now.

this is something I do all the time:

NSMutableArray args2 = new NSMutableArray();
args2.addObject("portfolio");
args2.addObject(portfolio);
myQualifier2 = EOQualifier.qualifierWithQualifierFormat("%@ = %@", args2);

NSArray results = EOQualifier .filteredArrayWithQualifier(portfolioUserGroups(),myQualifier2);


How do I make that "generic Java 1.5" friendly?


From Art:

http://weblogs.java.net/blog/arnold/archive/2005/06/generics_consid_1.html
http://www.mindview.net/WebLog/log-0050

YMMV  :-)

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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


_______________________________________________ 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


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________ 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: 
 >Educate me on generics please... (From: James Cicenia <email@hidden>)
 >Re: Educate me on generics please... (From: Chuck Hill <email@hidden>)
 >Re: Educate me on generics please... (From: "Mr. Pierre Frisch" <email@hidden>)
 >Re: Educate me on generics please... (From: James Cicenia <email@hidden>)
 >Re: Educate me on generics please... (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Educate me on generics please...
  • Next by Date: Re: Problems with Stale Data
  • Previous by thread: Re: Educate me on generics please...
  • Next by thread: Re: Educate me on generics please...
  • Index(es):
    • Date
    • Thread