Question Locked
0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
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.
2 replies
by kush.sharma Accepted solution
Clarifications
by tony hopkinson Accepted solution
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
This discussion is closed to new replies.
Trending Software posts
Sort by Trending
1 helpful
1 reply
0 helpful
20 replies
Question Unanswered
How Are Teams Testing AI-Generated Code Before Production?
0 helpful
0 replies
Discussion
Network Printer Works for Everyone Except Me
0 helpful
10 replies
0 helpful
4 replies