I am trying to understand how to implement plug-in components or a service provider interface in the .NET world. I suspect that I simply do not know the appropriate terminology for the search.
In particular, I play with a class Matrixthat has different servers. In its simplest matrix, two-parameter get and set methods and a constructor are presented. Implementation is not important to the end user. For example, depending on the size of the matrix, the matrix may be supported by an array in memory, a file, or a distributed keystore. I would like to hide the backend implementation and allow third parties to provide new backend implementations.
An ideal API called IronPython, say, could be something like
a = matrix(data = 0, rows = 1000, cols = 10, backend = 'file://test.txt')
a[100, 2] = 1
print a[100, 2]
What should I read to understand the pattern for this type of problem?
I play F # and IronPython, but I don't believe this question is specific to any particular .Net language.
source
share