1

I am going to develop some logic to get date from third party API. These API have different method names and parameters and I need to keep in mind about the pluggable components.

Also I have to maintain the log of success, failure, number of records fetch, credentials information etc.

Please suggest some example in C# so that I can start working on it.

1 Answers1

1

Here is the official MSDN plugin framework explained. Bassically what you need to do is to:

You just:

  • Create a shared interfaces library.
  • Create custom plug-ins implementing the custom interfaces.
  • Create context arguments to pass to the plug-ins.
  • Create a section in your config file to hold plug-in names.
  • Instantiate plug-ins using an IConfigurationSectionHandler implementer class.
  • Call your plug-ins.

Code-project example and more. I would suggest to also look at the bridge design pattern, since it allows you to decouple an abstraction from its implementation so that the two can vary independently. Also look at Proxy for the

maintain the log of success, failure, number of records fetch, credentials information etc.

For your request/response pairs a good fit is the Command, it'll encapsulate your request as an object, so you can parameterize clients with different requests, queue or log requests, and support undoable operations.

ekostadinov
  • 6,880
  • 3
  • 29
  • 47