By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,210 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,210 IT Pros & Developers. It's quick & easy.

C# 2.0, Generic Collection?

P: n/a
Hey all. Here's my question. I'm building a Shipping rates component
with the following classes:

Package which contains basic package information. I also have shipper
classes that implement an interface I built. They have basic shipper
information to their respective API's so I will have 3 different
Shipper classes: UPS, FedEx, and USPS. I would like the Package class
to contain a collection of generic shipper objects. I think this is
possible using generics correct? If so can someone point me in the
right direction? Thanks.

Jan 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Very doable. Mark your base class "abstract". Any methods that must be
implemented in the derived classes are also marked "abstract". In your base
class, use protected interfaces for class support routines and public
interfaces for those routines you want to inherit to the derived class's
interface.

Mike Ober.

<rh******@gmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
Hey all. Here's my question. I'm building a Shipping rates component
with the following classes:

Package which contains basic package information. I also have shipper
classes that implement an interface I built. They have basic shipper
information to their respective API's so I will have 3 different
Shipper classes: UPS, FedEx, and USPS. I would like the Package class
to contain a collection of generic shipper objects. I think this is
possible using generics correct? If so can someone point me in the
right direction? Thanks.

Jan 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.