A
Andy B
For holding multiple objects, what is the better way to hold them? a
collection class or an array?
collection class or an array?
For holding multiple objects, what is the better way to hold them? a
collection class or an array?
For holding multiple objects, what is the better way to hold them? a
collection class or an array?
sloan said:I prefer these days
public EmployeeCollection : List<Employee>
{
//yeah that's it.
}
I don't like List<Employee> all over the place.
And I'm future proofed if I ever need to put methods in ..specific to that
class.
[snip: interface]
and of course a concrete
[snip: class]
sloan said:Well, I (and my colleagues) actually do this. The previous answer was my
pop-shot answer.
public interface IEmployeeCollection :
IList<IEmployee>, ICollection<IEmployee>,
IEnumerable<IEmployee>,
IEnumerable
{
}
and of course a concrete
public class EmployeeCollection : List<IEmployee>, IEmployeeCollection
{
}
Any critical evaluation of that is welcomed as well. ( That is a sincere
request, not a challenge or sarcastic remark ).
..
My linq skills are subpar right now. Too much going on at work.
sloan said:LINQ
Yeah, I know. I was going to hit Silverlight 2.0 first, then LINQ. Brad
Abrams is coming to our usergroup meeting next week.
I'll be catching up on stuff starting in May, when my work stuff slows down
considerably.
Jon, I just got the Manning Publications email last night that the final
release is out.
Congrats!
I prefer these days
public EmployeeCollection : List<Employee>
{
//yeah that's it.
}
I don't like List<Employee> all over the place.
And I'm future proofed if I ever need to put methods in ..specific to that
class.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.