Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strongly typed dataset 1

Status
Not open for further replies.

Pumzy

Programmer
Nov 20, 2003
13
JP
Hi peeps! i am just wondrin bout the meaning of strongly typed dataset and as to what applications does it suits best. tnx

KDjLogan
 
A weakly-typed dataset (collection) uses variables of type Object to hold it's values. It's bad because you can add a Customer object to the collection when you meant for it to hold Item objects. Most new programmers would say "I would never do that -- I would only put Customers in my Customer collection". An experienced programmer would say "It's possible for a maintenance programmer to come behind me and do it wrong, so I'll prevent this from happening if I can."

The way to prevent a mixup like this is to define strongly-typed collections. That way when you attempt to add an Item to a collection that should only have Customer objects, the compiler flags it as an error, and the mistake is caught before a customer ever sees it.

All applications beyond the proof-of-concept stage should be using strongly-typed collections.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top