Design Patterns FME Workbench FME UC 2007 Design
Design Patterns FME Workbench FME UC 2007 Design Patterns 1
Introduction § Design Patterns for FME Workbench § Inspired by Emil Vulpin, formerly of Smallworld Australia § What is a design pattern? § In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. § It is a description or template for how to solve a problem that can be used in many different situations. Design Patterns 2
Introduction § The goal of the Design Patterns are to create FME Workbench designs that are: § as generic as possible to all FME Features, and § reduce duplication of effort. § There are several benefits including: § Minimal amount of Workbench transformers § Reduced Workbench complexity § Improve Workbench maintainability Design Patterns 3
Pattern Catalog § Central Workflow Approach § External Attribute Schema Map § External Attribute Value Map § External Style Metadata Map § Bookmarks § FME Custom Transformers § FME Custom Formats Design Patterns 4
Pattern 1 Central Workflow Pattern § The goal of the Central Workflow Pattern is to create an FME Workbench that is: § as generic as possible to all FME Features and § reduce duplication. § There are several benefits including: § Minimal amount of Workbench transformers § Reduced Workbench complexity § Improve Workbench maintainability § The Central Workflow pattern is applicable to most FME Workbench designs and should be considered before creating a new Workbench Design Patterns 5
Pattern 1 Central Workflow Pattern FME Workbench § Multiple source features enter the central workflow from a single point of entry (Sampler or Cloner) § FME Transformers are added to perform logic in a way that minimizes duplicate transformers § A Feature. Type. Filter is used to distribute features to the appropriate Destination Feature Type Definition Design Patterns 6
Pattern 1 Central Workflow Pattern § Don’t do this! Design Patterns 7
Pattern 1 Central Workflow Pattern § Do This! Design Patterns 8
Pattern 2 External Attribute Schema Map § The goal of the External Attribute Schema Map pattern is to: § simplify the mapping of attribute names between source & destination feature types § Used for complex attribute schema mapping definitions § An alternative to common FME Transformers such as Attribute. Renamer and Attribute. Copier § Benefits of this pattern include: § Simplification of the creation & maintenance of the attribute schema mapping definition § Reusability across different FME Workbench sessions § Simplifies the internal attribute connections functionality within FME Workbench for reasonably large FME Workbenches § Easily reversible! Design Patterns 9
Pattern 2 External Attribute Schema Map FME Workbench § § FME Workbench reads an external attribute schema map definition The definition defines the mapping from source attribute name to destination attribute name, i. e. : sw_attribute min_road_id name road_type § destination_attribute ID Name Road_Type The external attribute schema map definition can be defined in a number of tabular formats, e. g. Excel, CSV, Access, Oracle, My. SQL etc. Design Patterns 10
Pattern 2 External Attribute Schema Map Design Patterns 11
Pattern 2 External Attribute Schema Map Design Patterns 12
FME Schema. Mapper Transformer § Wizard with 4 primary parts: § § Schema Mapping database selection Filter definition Index Mapping (Feature Type Mapping) Attribute Mappings & Value Mapping § At least 11 different solution variations § See sample workbench and spreadsheet Design Patterns 13
Pattern 3 External Attribute Value Map § The goal of the External Attribute Value Map pattern is to: § simplify the mapping of attribute values (enumerated lists or domains) between source & destination feature types § This pattern is best suited for Workbenches that require complex and/or large attribute value mapping definitions § Benefits of this pattern include: § Simplify the creation & maintenance of the attribute value mapping definition § Promote reusability across different FME Workbench sessions § Easy to create the reverse mappings! Design Patterns 14
Pattern 3 External Attribute Value Map FME Workbench § The Workbench reads an external attribute value map definition § The definition defines the mapping from source attribute value to destination attribute value for any FME Feature, i. e. sw_carriage_type Dual Carriage Single Track Carriage_Type Divided Highway Divided Road Undivided Road § The external attribute value schema map definition can be defined in a number of tabular formats, e. g. Excel, CSV, Access, Oracle, My. SQL etc. Design Patterns 15
Pattern 4 External Style Metadata Map § The goal of the External Style Metadata Map pattern is to: § Provide a implementation for exporting styling information to stylable formats with Workbench § This pattern is applicable to all Workbench designs that require the export of style information § The export of style metadata is dependent on the destination format’s level of support for style metadata and FME’s level of support for writing to that format, i. e. ESRI SHAPE no style support, Map. Info has limited style support and Auto. CAD DWG more comprehensive style support. § The pattern allows for easy external modification of the styling aspects of the translation by non-FME users § The names of the columns should correspond to the FME format attributes for the target format § E. g. mapinfo_line_style, autocad_lineweight Design Patterns 16
mallworld CST Pattern 4 External Style Metadata Map FME Workbench Design Patterns 17
Pattern 5 Bookmarks § Bookmarks allow you to visually group related areas of a workspace § A naming convention should be used to improve navigation and findability § By employing bookmarks, the pattern will: § Improve understandability § Ease maintenance by improving navigation § Example Workspace Design Patterns 18
Pattern 6 FME Custom Transformers § FME Custom Transformers allow you to create a single transformer to replace a sequence of transformers from an existing workspace § Therefore, the goal of the FME Custom Transformers pattern is to provide a generic set of FME Custom Transformers that simplify the use of FME Workbench for common related designs § By doing so, the pattern will: § Simplify and improve reusability of common solutions § Encapsulate complexity from less experienced FME users Design Patterns 19
Pattern 7 FME Custom Formats § FME Custom Formats allow you to wrap different source schemas and transform them to a single common schema § Subsequent workspaces can be written to work with the common input schema § Details of the individual sources and thus hidden and encapsulated § By doing so, the pattern will: § Allow parallelism during development § Ensure local modifications have minimum impact § Result in simpler workspaces Design Patterns 20
Conclusion § Patterns provide guidelines for efficiently solving recurring types of problems with FME § Applying patterns can make you more productive § Applying patterns consistently can § Reduce maintenance efforts § Improve understandability Design Patterns 21
- Slides: 21