Wednesday, November 02, 2005

Thinking About Generics

A comment on my post on generics had me thinking - the question was simple - So, are generics just custom lists or are there any more uses I can think of? I thought it would be good to pause a little and think on what generics are to answer this question. Here's what i think (I am no expert on generics though:) )
Basically, Generics are a nice way of creating flexible data structures or type safe classes. The basic idea is that we implement the class that providers service in a 'generic' way. A Crude example... Public Class People <T> ... considering that <T> could be a student, friend, relative.... Now we can basically have the methods within the People class essentially work for students, friends and relatives as long they use algorithms with depend on common attributes of all these objects. Possibilities? Unlimited. All arguments are welcome :)

2 Comments:

Anonymous Anonymous said...

I saw your site in a page about alumna at SchoolBuddies.com. I'll check your site out and see if you have any new info sometime. Dave

1:04 PM  
Blogger rajivpopat said...

Thanks for leaving the comment dave. little surprising but nice to know people are being reffered to this site from places i couldn't dream of :)

8:57 PM  

Post a Comment

<< Home