Click here to Skip to main content
15,914,165 members
Home / Discussions / C#
   

C#

 
QuestionStack Trace? What is it? Pin
...---...18-Aug-05 15:12
...---...18-Aug-05 15:12 
AnswerRe: Stack Trace? What is it? Pin
Christian Graus18-Aug-05 15:27
protectorChristian Graus18-Aug-05 15:27 
GeneralImplementing Interfaces... Pin
Tim McCurdy18-Aug-05 15:06
Tim McCurdy18-Aug-05 15:06 
GeneralRe: Implementing Interfaces... Pin
Christian Graus18-Aug-05 15:13
protectorChristian Graus18-Aug-05 15:13 
GeneralRe: Implementing Interfaces... Pin
Tim McCurdy18-Aug-05 15:22
Tim McCurdy18-Aug-05 15:22 
GeneralRe: Implementing Interfaces... Pin
Matt Gerrans18-Aug-05 21:49
Matt Gerrans18-Aug-05 21:49 
GeneralRe: Implementing Interfaces... Pin
Matt Gerrans18-Aug-05 21:00
Matt Gerrans18-Aug-05 21:00 
GeneralRe: Implementing Interfaces... Pin
Tim McCurdy20-Aug-05 7:47
Tim McCurdy20-Aug-05 7:47 
You see, it's very simple. For someone who writes object models for a living, I've seen a lot that just don't make any sense (ex. Adobe, Maximizer, etc.). I hate when someone gives a method like "Remove" when I am working with a collection of Files (Remove what?). Instead, I like to rename the Method to "Delete" and implement the "Remove" method privately. The private method will simply call the Public method on the collection class.

Don't get me wrong, I implement as much as the interface as I "can". There are some methods though that I DO like, however, the fact that you have to pass an object instead of my custom (strongly-typed) collection object (i.e. a custom File object for example). For example, if you Implement the IDictionary Interface, it uses this: IndexOf(object Key). What? Since the Keys SHOULD all be strings in my collection, why do I want to allow a programmer to pass a Guid, Int, or whatever else they can think of? If they want a guid, pass a Guid.ToString().

If you look at a lot of the pre-defined Collection classes Microsoft created, they also "hide" a lot of interface methods because they just don't make sense for the particular object, but you can still cast them to an Interface that they implement and use the Properties / Methods that way.

Now, as to why I am implementing an IList? Well, It's nice to have a custom collection class that can be databound to a DataGrid or other controls.
GeneralRe: Implementing Interfaces... Pin
J4amieC18-Aug-05 23:28
J4amieC18-Aug-05 23:28 
GeneralRedim Arrays in C# Pin
mpastchenko18-Aug-05 14:45
mpastchenko18-Aug-05 14:45 
GeneralRe: Redim Arrays in C# Pin
Christian Graus18-Aug-05 15:01
protectorChristian Graus18-Aug-05 15:01 
GeneralRe: Redim Arrays in C# Pin
Tim McCurdy18-Aug-05 15:01
Tim McCurdy18-Aug-05 15:01 
GeneralRe: Redim Arrays in C# Pin
Tim McCurdy18-Aug-05 15:08
Tim McCurdy18-Aug-05 15:08 
GeneralRe: Redim Arrays in C# Pin
Dave Doknjas19-Aug-05 19:35
Dave Doknjas19-Aug-05 19:35 
GeneralRe: Redim Arrays in C# Pin
Mohamad Al Husseiny18-Aug-05 22:09
Mohamad Al Husseiny18-Aug-05 22:09 
GeneralRe: Redim Arrays in C# Pin
Azerax19-Aug-05 1:32
Azerax19-Aug-05 1:32 
GeneralRe: Redim Arrays in C# Pin
mpastchenko19-Aug-05 7:46
mpastchenko19-Aug-05 7:46 
Generalchanging properties Pin
spepperchin18-Aug-05 13:51
spepperchin18-Aug-05 13:51 
GeneralRe: changing properties Pin
Christian Graus18-Aug-05 15:02
protectorChristian Graus18-Aug-05 15:02 
GeneralRe: changing properties Pin
David Stone18-Aug-05 15:27
sitebuilderDavid Stone18-Aug-05 15:27 
Generalets.Compare DataSets.... Pin
bigals18-Aug-05 12:42
bigals18-Aug-05 12:42 
GeneralScreen Scraping + RDF Pin
A N Kureshi18-Aug-05 10:39
A N Kureshi18-Aug-05 10:39 
GeneralRe: Screen Scraping + RDF Pin
zitniet20-Aug-05 4:03
zitniet20-Aug-05 4:03 
GeneralRe: Screen Scraping + RDF Pin
A N Kureshi20-Aug-05 7:26
A N Kureshi20-Aug-05 7:26 
GeneralCopy files between networked computers Pin
RobC.18-Aug-05 10:23
RobC.18-Aug-05 10:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.