kim wrote:
> I am trying to learn csharp, and would like some advice
on storage
> containers for my sample application.
Well, you mention storage containers, but from what I
gathered in your
post, you mean more of business objects (or class
structures). If you
are asking about the storage mechanism, I can say that XML
is a
wonderful thing for people to start playing around with in
the .NET
Framework. If your data is somewhat small (string, numeric,
or
serialized object), then I certainly would recommend giving
the
System.Xml namespace a quick look.
As far as how to use your objects, a simple struct could
work, but I
almost always go with classes (more control).
> I have looked at arrays, arraylists, stacks and
indexers. Only the
> stack and arraylist appear to allow me to continue to
add items.
Are you working with .NET v1.1, or v2.0?
If the former, all you would really have to do is use an
ArrayList to
hold your data, that way you can .Add() very easily. Then
when you need
something you can serialize for [XML ;)] storage, simply
call the
ArrayList's .CopyTo() into an array of your particular
object type.
If the latter, life is even easier with generics
(System.Collections.Generic namespace). You should
absolutely look into
these if you are using v2.0. A simple Google search on
"c# generic
collections" should give you more than enough reading
material.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharp googlegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribe googlegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---
|