Provider or provider patterns are not unfamiliar to many people, and the provider model is applied extensively in DNN and ASP.net 2.0. The current mainstream of GIS platform data delivery should be basically based on provider such a pattern, we are more familiar with the SUPERMAP proposed by the concept of multi-source spatial data engine.
In Sharpmap, the data provider is used in this way:
String connstr =
"server=127.0.0.1;" port=5432; Userid=postgres; Password=password;database=mygisdb; ";
Mylayer.datasource = new SharpMap.Providers.PostGIS (connstr, "myTable", "The_geom",
32632);
In fact, in the layer class, DataSource is defined as:
Public SharpMap.Data.Providers.IProvider DataSource
{
...
}
That is, the provider here is for the Iprovider interface, so that for different layers, you can specify different data sources (using different data provider and supporting different data formats). The following is a class diagram of the provider interface that defines the properties and operations of the interface: