473,405 Members | 2,261 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,405 software developers and data experts.

Which is more efficient? Anyone know?

Just a query to see if anyone can tell me. Which is the quicker/best way of
a handling Type-Safe collections/Dictionaries?

1) Create a Custom Collection/Dictionary derived from
CollectionBase/DictionaryBase and implement as necessary - including
Type-Safe methods.

or - the lazier

2) Create a class, that has an internal Collection\Dictionary that is
added/removed from via implemented methods that are Type-Safe.

Anyone care to suggest?
Nov 15 '05 #1
2 1155
Hi,

1+) Use CodeSmith to generate fast strong typed collections for you
(certainly faster then 2) ):
http://www.ericjsmith.net/codesmith/

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"b0yce" <b0***@NOSPAMbtinternet.com> wrote in message
news:bv**********@hercules.btinternet.com...
Just a query to see if anyone can tell me. Which is the quicker/best way of a handling Type-Safe collections/Dictionaries?

1) Create a Custom Collection/Dictionary derived from
CollectionBase/DictionaryBase and implement as necessary - including
Type-Safe methods.

or - the lazier

2) Create a class, that has an internal Collection\Dictionary that is
added/removed from via implemented methods that are Type-Safe.

Anyone care to suggest?

Nov 15 '05 #2

"b0yce" <b0***@NOSPAMbtinternet.com> wrote in message
news:bv**********@hercules.btinternet.com...
Just a query to see if anyone can tell me. Which is the quicker/best way of a handling Type-Safe collections/Dictionaries?

1) Create a Custom Collection/Dictionary derived from
CollectionBase/DictionaryBase and implement as necessary - including
Type-Safe methods.

or - the lazier

2) Create a class, that has an internal Collection\Dictionary that is
added/removed from via implemented methods that are Type-Safe.
Well, this is basically al lthat CollectionBase and DictionaryBase does, it
provides an InnerList and InnerHashtable, respectivly, that you can write
your typesafe methods against.

If your looking for performance, you are better off getting a collection gen
util, the performance differences are significant. Anyone care to suggest?

Nov 15 '05 #3

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

Similar topics

3
by: wogston | last post by:
(A) template <typename T> metainline foo<T> lerp(const foo<T>& a, const foo<T>& b, const T& time) { foo<T> v; repeat< 4,exec_mul<T> >::exec(v,a,b,time); return v; }
9
by: Randell D. | last post by:
Folks, I have a large amount of values to store (we're talking tens, if not hundreds of bytes). I need this for a client side application - ignore the security consequences for the moment -...
10
by: Amit | last post by:
Which is more efficient and why? p++ or ++p. Thanks.
3
by: Ted Miller | last post by:
Hi folks, I've got an unmanaged routine I'm pinvoking to. It takes a pointer to an array of 3 pointers to bytes, typed as byte**. public static extern void foo(byte **p3pb); unsafe {...
16
by: Dustan | last post by:
I have a program that uses up a lot of CPU and want to make it is efficient as possible with what I have to work with it. So which of the following would be more efficient, knowing that l is a list...
19
by: santanu mishra | last post by:
Hi , I am stuck with a requirement from my client to change the date format from mm/dd/yy to dd/mm/yy .If any body can help me out with this regard as its very much urgent. Regards,...
50
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): ...
6
by: Christopher | last post by:
I've seen various ways of doing this, but what I want is to be able to take a base class pointer and know which derived class to cast to. For example I am going to make a base light class, that...
82
by: Bill David | last post by:
SUBJECT: How to make this program more efficient? In my program, a thread will check update from server periodically and generate a stl::map for other part of this program to read data from....
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.