Changes between Initial Version and Version 1 of Maestro2.5CustomCommands


Ignore:
Timestamp:
May 9, 2010 7:33:54 PM (9 years ago)
Author:
jng
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Maestro2.5CustomCommands

    v1 v1  
     1= Custom Commands =
     2
     3== The problem ==
     4
     5The current ServerConnectionI interface is a monolithic interface. It is hard to add functionality that may not be possible on certain implementations. A flexible way to extend functionality is required.
     6
     7== The solution ==
     8
     9Taking a page out of the FDO API, we will use a command-based API for defining custom functionality
     10
     11{{{
     12
     13public interface ICommand
     14{
     15    ...
     16    IServerConnection Parent { get; }
     17}
     18
     19public interface IServerConnection
     20{
     21    ...
     22 
     23    ICommand CreateCommand(int commandType);
     24
     25    ...
     26}
     27
     28}}}
     29
     30A capability API will also be made available so that certain implementations can advertise what commands they support.
     31
     32Through this command mechanism, we can then define custom commands that certain implementations of IServerConnection may or may not choose to implement.
     33
     34For example, Bulk copying.
     35
     36{{{
     37
     38// Copies features from one feature source to another
     39public interface IBulkCopy : ICommand
     40{
     41    string SourceFeatureSource { get; set; }
     42
     43    string TargetFeatureSource { get; set; }
     44
     45    void AddMapping(BulkCopyMapping mapping);
     46
     47    void Execute(IBulkCopyProgressCallback callback);
     48}
     49
     50public class BulkCopyMapping
     51{
     52    public string SourceFeatureClass { get; set; }
     53    public string TargetFeatureClass { get; set; }
     54
     55    ...
     56}
     57
     58}}}
     59
     60Another example, re-projecting features
     61
     62{{{
     63
     64// Selects features from the specified feature class and re-projects them to the
     65// target coordinate system.
     66public interface IReprojectFeatures : ICommand
     67{
     68    public string SourceFeatureSource { get; set; }
     69
     70    public string SourceFeatureClass { get; set; }
     71
     72    public string Filter { get; set; }
     73
     74    public string SourceCoordinateSystem { get; set; }
     75
     76    public string TargetCoordinateSystem { get; set; }
     77
     78    public void Execute(IReprojectFeaturesCallback callback);
     79}
     80
     81}}}
     82
     83These are just some examples off the top of my head, but a whole stack of geo-processing functionality could be made available through such an approach.