choice for collections of objects in a Windows Application development project

I am a college student trying to build a small windows application using Visual Studio 2005.

Business Context:

Simulation of a computer science department that contains faculty, students, courses, advisors etc.

My question:

1) Some of the entities will obviously be the ones mentioned above. When I built the class diagram, I felt a good design choice would be that a department class would contain collections of faculty, courses advisors, degree programs etc.

What do you think will be the best collection type to capture these objects or collections of objects such as ArrayList or List ? Can you capture them as Faculty[], advisor[] etc.? If yes, how?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

An ArrayList is good because it's easy to use, plus it can hold any object, as long as you cast it back.

ArrayList al = new ArrayList();

//it's easy to add objects to an ArrayList!
MyObject myObject = new MyObject();

//it's also easy to cast back to MyObject.
foreach(MyObject myObj in al)

//or if you want to use an index, say you added 3 of MyObjects to the ArrayList and
//you wanted to call the 2nd one in the list

MyObject myObject = (MyObject)al[1];  //ArrayList is 0 based


//here we use as to cast the 2nd entry in the ArrayList to a MyObject type and then call MyMethod
(al[1] as MyObject).MyMethod();
A hastable is faster in access and in addition it gives you a key value pair where value could be a object. So retrival is based onn they key name and not list of no's as in arraylist.

I would recommend you to use a hashtable.
use the CollectionBase


using System.Collection;

public class Faculty


public class Deptment : CollectionBase
 void AddFaculty(Faculty newFaculty)

This will give you stronged typed collection. Here's a link that will provide you with more details


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.