473,387 Members | 1,844 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,387 software developers and data experts.

UGH, Framework goes just so far AGAIN!

Ok, what is up here.

The 2005 framework contains all kinds of cool new structures now that we
have Generics and all but they always seem to fall just short of exactly
what I need.

In 2003 I needed a sets construct and they did not have it so I had to
create one. I am not sure yet if they have one in 2005 yet BTW...

I was dealing with the Dictionary last night and thought it would be a great
way for me to keep a strongly types indexed list of objects and their names.
The problem is that I wanted to be able to access the objects by BOTH index
and name. Boy was I surprised to find that the standard Dictionary object
doe snot guarantee that the order of the items added is reserved.

UGH!

How many times do you see cases in MS apps where you can access a collection
of items by index and name via two overloaded methods?

Workbooks(0)
Workbooks("Book1")

What the heck to they use behind the scenes? And if they have one why not
share...

UGH.... 3 hours latter I have an OrderedDictionary class that I had to put
together myself...

I know they can't anticipate everyone's needs but this one seems like
something that should have made it.

I have to design unit tests for all the cases to test it too.
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/
Jan 24 '06 #1
6 1102
You can enumerate through DictionaryEntry types if you like. Plus there are
a number of collection types you can use in the System.Collection namepsace.
To me this is 10,000x better then the dumb old Collection class of VB6....

http://msdn.microsoft.com/library/de...ollections.asp

"Ray Cassick (Home)" wrote:
Ok, what is up here.

The 2005 framework contains all kinds of cool new structures now that we
have Generics and all but they always seem to fall just short of exactly
what I need.

In 2003 I needed a sets construct and they did not have it so I had to
create one. I am not sure yet if they have one in 2005 yet BTW...

I was dealing with the Dictionary last night and thought it would be a great
way for me to keep a strongly types indexed list of objects and their names.
The problem is that I wanted to be able to access the objects by BOTH index
and name. Boy was I surprised to find that the standard Dictionary object
doe snot guarantee that the order of the items added is reserved.

UGH!

How many times do you see cases in MS apps where you can access a collection
of items by index and name via two overloaded methods?

Workbooks(0)
Workbooks("Book1")

What the heck to they use behind the scenes? And if they have one why not
share...

UGH.... 3 hours latter I have an OrderedDictionary class that I had to put
together myself...

I know they can't anticipate everyone's needs but this one seems like
something that should have made it.

I have to design unit tests for all the cases to test it too.
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/

Jan 24 '06 #2

Ray Cassick (Home) wrote:
Ok, what is up here.

The 2005 framework contains all kinds of cool new structures now that we
have Generics and all but they always seem to fall just short of exactly
what I need.

In 2003 I needed a sets construct and they did not have it so I had to
create one. I am not sure yet if they have one in 2005 yet BTW...

I was dealing with the Dictionary last night and thought it would be a great
way for me to keep a strongly types indexed list of objects and their names.
The problem is that I wanted to be able to access the objects by BOTH index
and name. Boy was I surprised to find that the standard Dictionary object
doe snot guarantee that the order of the items added is reserved.

UGH!

How many times do you see cases in MS apps where you can access a collection
of items by index and name via two overloaded methods?

Workbooks(0)
Workbooks("Book1")

What the heck to they use behind the scenes? And if they have one why not
share...

UGH.... 3 hours latter I have an OrderedDictionary class that I had to put
together myself...


Did SortedList not do what you want?

--
Larry Lard
Replies to group please

Jan 24 '06 #3
Have you tried System.Collections.Specialized.OrderedDictionary or
System.Collection.Generics.SortedDictionary (new in 2.0) ?

For set operations you could also likely implement this using the BitArray
class (also available in 1.1)

--
Patrice

"Ray Cassick (Home)" <rc************@enterprocity.com> a écrit dans le
message de news:uF*************@TK2MSFTNGP15.phx.gbl...
Ok, what is up here.

The 2005 framework contains all kinds of cool new structures now that we
have Generics and all but they always seem to fall just short of exactly
what I need.

In 2003 I needed a sets construct and they did not have it so I had to
create one. I am not sure yet if they have one in 2005 yet BTW...

I was dealing with the Dictionary last night and thought it would be a great way for me to keep a strongly types indexed list of objects and their names. The problem is that I wanted to be able to access the objects by BOTH index and name. Boy was I surprised to find that the standard Dictionary object
doe snot guarantee that the order of the items added is reserved.

UGH!

How many times do you see cases in MS apps where you can access a collection of items by index and name via two overloaded methods?

Workbooks(0)
Workbooks("Book1")

What the heck to they use behind the scenes? And if they have one why not
share...

UGH.... 3 hours latter I have an OrderedDictionary class that I had to put
together myself...

I know they can't anticipate everyone's needs but this one seems like
something that should have made it.

I have to design unit tests for all the cases to test it too.
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-5973
Blog: http://spaces.msn.com/members/rcassick/

Jan 24 '06 #4
In addition to the other comments:

| I was dealing with the Dictionary last night and thought it would be a
great
| way for me to keep a strongly types indexed list of objects and their
names.
It sounds like you may want an
System.Collections.ObjectModel.KeyedCollection(Of T)

http://msdn2.microsoft.com/ms132438(en-US,VS.80).aspx

As it works very similiar to how Office (Word, Excel) collections work.

NOTE: KeyedCollection is based on each object being "Named", rather then
storing key/value pairs.
Other collection classes I find useful for "domain models":

System.Collections.ObjectModel.Collection(Of T)
http://msdn2.microsoft.com/ms132397(en-US,VS.80).aspx

System.Collections.ObjectModel.ReadOnlyCollection( Of T)
http://msdn2.microsoft.com/ms132474(en-US,VS.80).aspx
Another source for various collections is Power Collections:
http://www.wintellect.com/powercollections/

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:uF*************@TK2MSFTNGP15.phx.gbl...
| Ok, what is up here.
|
| The 2005 framework contains all kinds of cool new structures now that we
| have Generics and all but they always seem to fall just short of exactly
| what I need.
|
| In 2003 I needed a sets construct and they did not have it so I had to
| create one. I am not sure yet if they have one in 2005 yet BTW...
|
| I was dealing with the Dictionary last night and thought it would be a
great
| way for me to keep a strongly types indexed list of objects and their
names.
| The problem is that I wanted to be able to access the objects by BOTH
index
| and name. Boy was I surprised to find that the standard Dictionary object
| doe snot guarantee that the order of the items added is reserved.
|
| UGH!
|
| How many times do you see cases in MS apps where you can access a
collection
| of items by index and name via two overloaded methods?
|
| Workbooks(0)
| Workbooks("Book1")
|
| What the heck to they use behind the scenes? And if they have one why not
| share...
|
| UGH.... 3 hours latter I have an OrderedDictionary class that I had to put
| together myself...
|
| I know they can't anticipate everyone's needs but this one seems like
| something that should have made it.
|
| I have to design unit tests for all the cases to test it too.
|
|
| --
| Raymond R Cassick
| CEO / CSA
| Enterprocity Inc.
| www.enterprocity.com
| 3380 Sheridan Drive, #143
| Amherst, NY 14227
| V: 716-316-5973
| Blog: http://spaces.msn.com/members/rcassick/
|
|
Jan 24 '06 #5
Ok, so I ended up building my own implementation of a Sorted List :)

But, I still have to do some digging because I am not sure if there is a
sorted list that handles Generics now :)

"Larry Lard" <la*******@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

Ray Cassick (Home) wrote:
Ok, what is up here.

The 2005 framework contains all kinds of cool new structures now that we
have Generics and all but they always seem to fall just short of exactly
what I need.

In 2003 I needed a sets construct and they did not have it so I had to
create one. I am not sure yet if they have one in 2005 yet BTW...

I was dealing with the Dictionary last night and thought it would be a
great
way for me to keep a strongly types indexed list of objects and their
names.
The problem is that I wanted to be able to access the objects by BOTH
index
and name. Boy was I surprised to find that the standard Dictionary object
doe snot guarantee that the order of the items added is reserved.

UGH!

How many times do you see cases in MS apps where you can access a
collection
of items by index and name via two overloaded methods?

Workbooks(0)
Workbooks("Book1")

What the heck to they use behind the scenes? And if they have one why not
share...

UGH.... 3 hours latter I have an OrderedDictionary class that I had to
put
together myself...


Did SortedList not do what you want?

--
Larry Lard
Replies to group please

Jan 26 '06 #6
The generic collections in .NET 2.0 are in System.Collections.Generic &
System.Collections.ObjectModel.

You can read about SortedList(Of T) here:

http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx

There is also a SortedDictionary(Of T):

http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
| Ok, so I ended up building my own implementation of a Sorted List :)
|
| But, I still have to do some digging because I am not sure if there is a
| sorted list that handles Generics now :)
|
| "Larry Lard" <la*******@hotmail.com> wrote in message
| news:11**********************@g47g2000cwa.googlegr oups.com...
| >
| > Ray Cassick (Home) wrote:
| >> Ok, what is up here.
| >>
| >> The 2005 framework contains all kinds of cool new structures now that
we
| >> have Generics and all but they always seem to fall just short of
exactly
| >> what I need.
| >>
| >> In 2003 I needed a sets construct and they did not have it so I had to
| >> create one. I am not sure yet if they have one in 2005 yet BTW...
| >>
| >> I was dealing with the Dictionary last night and thought it would be a
| >> great
| >> way for me to keep a strongly types indexed list of objects and their
| >> names.
| >> The problem is that I wanted to be able to access the objects by BOTH
| >> index
| >> and name. Boy was I surprised to find that the standard Dictionary
object
| >> doe snot guarantee that the order of the items added is reserved.
| >>
| >> UGH!
| >>
| >> How many times do you see cases in MS apps where you can access a
| >> collection
| >> of items by index and name via two overloaded methods?
| >>
| >> Workbooks(0)
| >> Workbooks("Book1")
| >>
| >> What the heck to they use behind the scenes? And if they have one why
not
| >> share...
| >>
| >> UGH.... 3 hours latter I have an OrderedDictionary class that I had to
| >> put
| >> together myself...
| >
| > Did SortedList not do what you want?
| >
| > --
| > Larry Lard
| > Replies to group please
| >
|
|
Jan 26 '06 #7

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

Similar topics

2
by: fripper | last post by:
I have installed Visual Studio .Net 2003 on top of an earlier version. Now, when I open a new project I get a message that says Visual Studio .NET has detected that the web server is running...
21
by: Sharon | last post by:
I wish to build a framework for our developers that will include a singleton pattern. But it can not be a base class because it has a private constructor and therefore can be inherit. I thought...
2
by: Mel | last post by:
Is anyone out there using a C#.NET OR mapping framework in a production environment? I'm thinking of such frameworks as nHibernate, Gentle, etc.. I've looked at quite a few but none of them seem...
6
by: Joseph Geretz | last post by:
I recently upgraded my server to Windows 2003. The first thing I noticed is that my sample WebService pages no longer worked. The Invoke test button is missing. This is addresed by the following KB...
23
by: Nak | last post by:
Hi there, Has anyone any ideas if the next Framework will be an update to version 1.1 or another completely new install so that people have 3 Frameworks on their system? And can VS.NET 2003 be...
4
by: Steve | last post by:
I have written a small program and created a set up and deployment package. I burned the files to cd and took them to another computer. When I click the set up file or the .msi file I get the...
7
by: therod | last post by:
I am running Windows Server 2003 SP1 and .Net Framework 1.1 I want to upgrade to .Net 2.0 and I'm pretty sure I should uninstall 1.1 first. Problem is that .NET 1.1 doesn't show up in Control...
13
by: dancer | last post by:
I have made a new post because when I try to respond to another, I get the error, "Article Rejected -- Ill-formed message id" This is in response to the advice of Juan Libre to install Net...
0
by: waghmarerajendra | last post by:
I am working in .NET compact framework 1.1 and developing WINCE based application and running it on .NET emulator. I am developing an application where there is an UI and some background...
9
by: kashif73 | last post by:
Sorry in advance for this stupid question but I am really a new developer of .NET. I have developed a data entry application using VB.NET, in visual Studio 2008. While I publish the application...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.