Question

Locked

runtime creation of classes?

By kush.sharma ·
I want to externalize the definition of classes to a xml fle and parse that file to get the declarative information about classes and use reflectionto create the classes and I should also be able to invoke them at runtime. can I separate the creation of classes from the invocation of the methods.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Yes

by Tony Hopkinson In reply to runtime creation of class ...

Is there some reason why you aren't using serialization?

I do this sort of thing with extension methods.

put all the calsses and their 'nornal functionality in one assembly.
Craete another assembly add a static classv for each one you want to load (same name is convenient) with a load method that extends the class to be loaded.

e.g.

internal static class SomeClass
{
public static SomeClass Load(this Some.Other.NameSpace.SomeClass argTarget, String argXmlSnippet)
{
}
}

this in loader dll would instantiate some class from someother dll, and fill it in from the xml.

Hths

Back to Software Forum
1 total post (Page 1 of 1)  

Related Forums