473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Collection Classes

I'm converting over to .net via c# from vb6. There was
this great article called the house of bricks that showed
you how to create a strongly typed collection class.
In .net I have found the CollectionBase and DictionaryBase
that I can create these from, but I also noted that I can
support the IEnum's as well using something like an
ArrayList to store the data.

What I would like to know is, is there another article out
there like House of Bricks that can give me the pitfalls
of which way to create strongly typed collection type
classes?

or what is the "best" way to do this.

Thanx in advance....
Nov 22 '05 #1
4 2084
Hi Kevin,

You might check (free) CodeSmith tool that does it and much much more..
http://www.ericjsmith.net/codesmith/

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Kevin Phifer" <ke***@nospam.plumcon.com> wrote in message
news:01****************************@phx.gbl...
I'm converting over to .net via c# from vb6. There was
this great article called the house of bricks that showed
you how to create a strongly typed collection class.
In .net I have found the CollectionBase and DictionaryBase
that I can create these from, but I also noted that I can
support the IEnum's as well using something like an
ArrayList to store the data.

What I would like to know is, is there another article out
there like House of Bricks that can give me the pitfalls
of which way to create strongly typed collection type
classes?

or what is the "best" way to do this.

Thanx in advance....

Nov 22 '05 #2
Hi Kevin,

You might check (free) CodeSmith tool that does it and much much more..
http://www.ericjsmith.net/codesmith/

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

"Kevin Phifer" <ke***@nospam.plumcon.com> wrote in message
news:01****************************@phx.gbl...
I'm converting over to .net via c# from vb6. There was
this great article called the house of bricks that showed
you how to create a strongly typed collection class.
In .net I have found the CollectionBase and DictionaryBase
that I can create these from, but I also noted that I can
support the IEnum's as well using something like an
ArrayList to store the data.

What I would like to know is, is there another article out
there like House of Bricks that can give me the pitfalls
of which way to create strongly typed collection type
classes?

or what is the "best" way to do this.

Thanx in advance....

Nov 22 '05 #3
"Kevin Phifer" <ke***@nospam.plumcon.com> wrote in news:019301c3ad80
$7****************@phx.gbl:
I'm converting over to .net via c# from vb6. There was
this great article called the house of bricks that showed
you how to create a strongly typed collection class.
In .net I have found the CollectionBase and DictionaryBase
that I can create these from, but I also noted that I can
support the IEnum's as well using something like an
ArrayList to store the data.

What I would like to know is, is there another article out
there like House of Bricks that can give me the pitfalls
of which way to create strongly typed collection type
classes?

or what is the "best" way to do this.


I've created a simple collection generator and some templates. Each has
a short description of their purpose...

http://sourceforge.net/projects/colcodegen

One of them inherits from CollectionBase and implements IDictionary.
Know that CollectionBase already implements IEnumerable, IList, and
ICollection.

IList is a really important one if you want your collection to be
bindable to a DataGrid.

Also here is an article that creates a new collection type implementing
IDictionary and IEnumerable only:

http://www.codeproject.com/csharp/hashlistarticle.asp

Overall, for replicating the VB6 collection just inherit from
CollectionBase and add an internal HashTable for storing by key in
addition to by index (CollectionBase). THe templates on my open source
project site do this.

Michael Lang, MCSD
Nov 22 '05 #4
"Kevin Phifer" <ke***@nospam.plumcon.com> wrote in news:019301c3ad80
$7****************@phx.gbl:
I'm converting over to .net via c# from vb6. There was
this great article called the house of bricks that showed
you how to create a strongly typed collection class.
In .net I have found the CollectionBase and DictionaryBase
that I can create these from, but I also noted that I can
support the IEnum's as well using something like an
ArrayList to store the data.

What I would like to know is, is there another article out
there like House of Bricks that can give me the pitfalls
of which way to create strongly typed collection type
classes?

or what is the "best" way to do this.


I've created a simple collection generator and some templates. Each has
a short description of their purpose...

http://sourceforge.net/projects/colcodegen

One of them inherits from CollectionBase and implements IDictionary.
Know that CollectionBase already implements IEnumerable, IList, and
ICollection.

IList is a really important one if you want your collection to be
bindable to a DataGrid.

Also here is an article that creates a new collection type implementing
IDictionary and IEnumerable only:

http://www.codeproject.com/csharp/hashlistarticle.asp

Overall, for replicating the VB6 collection just inherit from
CollectionBase and add an internal HashTable for storing by key in
addition to by index (CollectionBase). THe templates on my open source
project site do this.

Michael Lang, MCSD
Nov 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: downwitch | last post by:
Hi, I know this has been covered here and in the .public groups, but it seems like it's been a while, especially around here, so I just thought I'd ask again to see if anyone has figured out a...
11
by: Pavils Jurjans | last post by:
Hello, There's some confusion about the purpose and difference between these handy classes... First, both of them are holding number of key - value pairs, right? Then, I see that there may be...
2
by: Robert W. | last post by:
I'm trying to write a utility that will use Reflection to examine any data model I pass it and correctly map out this model into a tree structure. When I say "any" , in fact there will only be 3...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
16
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a...
4
by: Andrew | last post by:
I need to have a series of collection classes that inherit (I think) from each other. What is the best way to do this in .NET? In VB6 I had a series of collection classes each passing a reference...
3
by: Dave | last post by:
Please - anyone that can help. I am getting confusing results while trying to expose a collection from a web service. I have a webservice in which a web method accepts a collection as a...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
7
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Can someone explain a few things about collections to me. In C# 2 generics, you can create a collection class by inheriting from System.Collections.ObjectModel.Collection. Using this you can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.