Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Product Architecture
Message
From
06/02/2009 20:44:52
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
06/02/2009 20:38:31
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
Miscellaneous
Thread ID:
01379573
Message ID:
01379987
Views:
27
>>>>John,
>>>>About your second approach...
>>>>
>>>>So what you're saying is that I build my core components (NewsReader, Blog, ProductList, etc...) and have them each in a DLL. I would use reflection to load the DLL's. If a client wants to use NewsReaderOnSteroids instead of NewsReader, I would just develop the new component and deploy it in place of the existing DLL? I suppose I could use my config file to specify while DLL should get loaded for the component.
>>>>
>>>>I would think that this approach would lean heavily on implementing effective interfaces?
>>>
>>>
>>>That's true. If you want, I can send you some code snippets that we used. We allowed our clients to add custom code processing to an import process so that we didn't have to rewrite the entire load. The dll's were loaded on the fly using reflection and executed the customers code in the custom dll.
>>
>>John,
>>Some code snippets would be very helpful.
>>
>>I am having issues with the LoadData line saying "Object reference not set to an instance of an object" and I just can't figure out the syntax to create a new instance of my class.
>>
>>            Type myType = Assembly.LoadFile(@"C:\Newsletter.dll").GetType("NewsLetter");
>>
>>            INewsletter myNewsLetter = myType;
>>
>>            myNewsLetter.LoadData();
>>
>
>
>You can create an instance of myType with Activator.CreateInstance. Then check out Method.Invoke for actually running the method. I can't send the code till monday...

I might be able to figure it out from that. Thanks again!
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform