Changes between Version 2 and Version 3 of MapGuideRfc9


Ignore:
Timestamp:
02/10/07 22:08:22 (18 years ago)
Author:
robertbray
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc9

    v2 v3  
    2323== Overview ==
    2424
    25 This section brefly describes the problem set, and the proposed solution in general terms.  It should be deliberately short, a couple of sentences or so.
     25In writing sample applications for !MapGuide I have noticed a few reoccurring patterns in the application code. In particular when querying or updating feature data typically you have to get the feature source information from the !MgLayer and then turn around and pass all of that information on to Feature Service operations. This RFC aims to clean up this particular reoccurring pattern.
    2626
    2727== Motivation ==
    2828
    29 This is the most important part of the RFC.  It describes the problem domain in detail.  Focusing on this will allow reviewers to fully understand why the proposed change is being made, and potentially suggest different/better ways of accomplishing the desired results.  The more time we spend on understanding the problem, the better our solution will be.
     29Here is a simplified pattern that occurs frequently in !MapGuide applications:
     30
     31{{{
     32$resourceService = $site->CreateService(MgServiceType::ResourceService);
     33$featureService = $site->CreateService(MgServiceType::FeatureService);
     34
     35$map = new MgMap();
     36$map->Open($resourceService, $_POST['MAPNAME']);
     37$layer = $map->GetLayers()->GetItem($_POST['LAYERNAME']);
     38
     39$resId = new MgResourceIdentifier($layer->GetFeatureSourceId());
     40$featureClass = $layer->GetFeatureClassName();
     41
     42$featureService = $this->site->CreateService(MgServiceType::FeatureService);
     43
     44$reader = $featureService->SelectFeatures($resId, $featureClass, null);
     45}}}
     46
     47With the API enhancements recommended by this RFC, a more convenient and compact form might be written like this:
     48
     49{{{
     50
     51$map = new MgMap($site);
     52$map->Open($_POST['MAPNAME']);
     53$layer = $map->GetLayers()->GetItem($_POST['LAYERNAME']);
     54
     55$reader = $layer->SelectFeatures(null);
     56}}}
     57
    3058
    3159== Proposed Solution ==