• 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: Ian Joyner <email@hidden>
  • Date: Thu, 7 Feb 2008 11:06:32 +1100

On 07/02/2008, at 7:37 AM, 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

Hey, I used to work with David Holmes, many a happy hour spent discussing type systems, etc. (Well, OK maybe a few arguments as well). He put in a tremendous effort reviewing my own book.


The article seems to dismiss generics altogether, but it is just the poor implementation in Java. Sun was not prepared to fix the JVM, in fact at OOPSLA in Vancouver in 1997 I remember someone getting up and telling Sun to "just fix the damn JVM". Sun never did.

I'd use generics for two reasons:

* you put the type spec in once in the generic in a neat declaration instead of clutter all over the code in the form of type casts (which are evil and should be abolished) (hence code is easier to change - just one change and recompile, OK refactoring support in IDEs make that easier, but that is just solving an introduced problem, that should not have been there in the first place).
* errors are caught at compile time


They are mainly used to specify a least required object type in collections.

This discussion is rather like the one they have just had on Cocoa-dev on garbage collection. Generics, multiple inheritance, and GC are great ideas and done properly simplify programming, but when hacked into something that didn't provide for them in the first place make programming more complicated. Hence, people mistakenly write them off. (I think the GC seems to be well done for Objective-C and Cocoa, but the problem seems to be in its interaction with C.)

Ian


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


  • Follow-Ups:
    • Re: Educate me on generics please...
      • From: Chuck Hill <email@hidden>
References: 
 >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: Educate me on generics please...
  • Previous by thread: Re: Educate me on generics please...
  • Next by thread: Re: Educate me on generics please...
  • Index(es):
    • Date
    • Thread