473,804 Members | 3,396 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Book 1")

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

UGH.... 3 hours latter I have an OrderedDictiona ry 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 1127
You can enumerate through DictionaryEntry types if you like. Plus there are
a number of collection types you can use in the System.Collecti on 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("Book 1")

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

UGH.... 3 hours latter I have an OrderedDictiona ry 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("Book 1")

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

UGH.... 3 hours latter I have an OrderedDictiona ry 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.Collecti ons.Specialized .OrderedDiction ary or
System.Collecti on.Generics.Sor tedDictionary (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.c om> a écrit dans le
message de news:uF******** *****@TK2MSFTNG P15.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("Book 1")

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

UGH.... 3 hours latter I have an OrderedDictiona ry 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.Collecti ons.ObjectModel .KeyedCollectio n(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.Collecti ons.ObjectModel .Collection(Of T)
http://msdn2.microsoft.com/ms132397(en-US,VS.80).aspx

System.Collecti ons.ObjectModel .ReadOnlyCollec tion(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.c om> wrote in message
news:uF******** *****@TK2MSFTNG P15.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("Book 1")
|
| What the heck to they use behind the scenes? And if they have one why not
| share...
|
| UGH.... 3 hours latter I have an OrderedDictiona ry 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*******@hotm ail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.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("Book 1")

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

UGH.... 3 hours latter I have an OrderedDictiona ry 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.Collecti ons.Generic &
System.Collecti ons.ObjectModel .

You can read about SortedList(Of T) here:

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

There is also a SortedDictionar y(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.c om> wrote in message
news:%2******** ********@TK2MSF TNGP15.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*******@hotm ail.com> wrote in message
| news:11******** **************@ g47g2000cwa.goo glegroups.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("Book 1")
| >>
| >> What the heck to they use behind the scenes? And if they have one why
not
| >> share...
| >>
| >> UGH.... 3 hours latter I have an OrderedDictiona ry 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
7117
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 ASP.NET version 1.0 ... it goes on to say that I can create the project to be compliant with version 1.0 but that the application will not be able to use the newer features of ASP .NET 1.1. Now, having installed VS .Net 2003 I understand that I have...
21
2471
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 maybe a Template can be use for that, but C# does not support Templates (will be C# generics in mid 2005). Does anyone have a solution on how the singleton pattern can be written, in C#, as a framework/ infrastructure class, so users can use this...
2
2738
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 mature enough for serious use. Looking for suggestions. Thanks.
6
2084
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 article: Microsoft Knowledge Base Article - 819267 INFO: HTTP GET and HTTP POST Are Disabled by Default http://support.microsoft.com/default.aspx?scid=kb;en-us;819267 The article advises that a new block be inserted into Web.config (or into
23
1934
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 set to use any Framework other than 1.1? Nick. --
4
1336
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 following error message: This set up requires the .Net Framework version 1.1.4322. Please install the .Net Framework and run this setup again. The .Net Framework can be obtained from the web. Would you like to do this now?
7
8529
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 Panel->Add Remove Programs. Anyone know the correct way to upgrade to .NET 2.0? Tom
13
6661
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 Framework Service Pack 1 in order to use ASP.net 1.1 and the net Framework 1.1 ------------------------------------------------------------------------------------------------ I found the following file, "svcpack.log" at C:\WINNT. It contains many...
0
954
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 processing. On UI there are start, stop, pause, and resume buttons and a progress bar. When I click on start I am updating progress bar value with value starting from 1. When that value goes to 20 progress bar is full. Now I have pause button to pause the...
9
1741
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 using Publish option, in pre-requisites I check the option of .dotnet framework 2.0, then i check download pre-requisite from vendor's website. Once i run the setup exe, it goes to vendors website for download of framework 2.0. I dont want this to...
0
9575
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.