C# 2.0, Generic Collection?

R

rh1200la

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.
 
M

Michael D. Ober

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top