C++ Template Class or #define macro in VB.NET?

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

I'm working on code that has several (approx 50) very similar objects.
They all inherit from a base class that can contain several of the
methods I need, but the methods that specifically need the object type
(e.g. code that creates objects with New) have to be implimented in
the code for the separate objects. In C++ I could use a template
class that would let me write code like this just once in a template
class. Is there anything like this available in vb.net?

The vs.net regular expression search and replace has made it easier to
edit all 50 pieces of code at once, but it would be great if the code
was only there once!

TIA -- Marie
 
Michelle,
You will need to wait for Whidbey (VS.NET 2004) for Generics, .NET
equivalent of C++ Templates.

http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx
http://msdn.microsoft.com/msdnmag/issues/03/09/NET/default.aspx

#define macros are not support.

I do not have links handy, there are a couple of collection generator
add-ins available that will create the skeleton collection classes for you.
You might try searching this newsgroup in groups.google.com for links, or
searching user samples at www.gotdotnet.com.

Hope this helps
Jay
 
Back
Top