Polymorphic question

  • Thread starter Yankee Imperialist Dog
  • Start date
Y

Yankee Imperialist Dog

Polymorphic question.
I have a single solution with multiple projects. Using abstract base classes
in the Business Objects layer I’m creating multiple derived classes in say
the DAL. I’m running into an issue where I can’t get around having to load
the assembly to reflect, and get the type. What I’m doing is attempting to
pass a string representing the derived class to be loaded into a list of type
base class, hence the need to load the dll.
There has to be a better way (I hope)
 
P

Peter Morris

Option 1:

[OwnedClass(typeof(SomeNameSpace.Person))]
[OwnedClass(typeof(SomeOtherNameSpace.Customer))]
public class MyPackage
{
}

Then reflect over those.


Option 2:
Have a config file that lists all assemblies which must be loaded and
reflected over.
 

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

Similar Threads


Top