简体   繁体   中英

C# Passing data from client to DLL

I have a client that has a number of plugin dll's that communicate via a single interface. Within the client, their is often a change of database.

This state is maintained internally by a simple string.

How would be the best way to update the dll's when this changes. Should I simply create a stringbuilder(reference type) and pass that through the interface to the each dll?

Or is there a way that the dll can monitor an event on the client for this?

Thanks.

You can use observer pattern. Here is a definition and example of observer pattern:

http://www.dofactory.com/Patterns/PatternObserver.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM