210 likes | 238 Views
Design Patterns FME Workbench. FME UC 2007. Introduction. Design Patterns for FME Workbench Inspired by Emil Vulpin, formerly of Smallworld Australia What is a design pattern?
E N D
Design Patterns FME Workbench FME UC 2007
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.
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
Pattern Catalog • Central Workflow Approach • External Attribute Schema Map • External Attribute Value Map • External Style Metadata Map • Bookmarks • FME Custom Transformers • FME Custom Formats
Pattern 1Central 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
FME Workbench Pattern 1Central Workflow Pattern • 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 FeatureTypeFilter is used to distribute features to the appropriate Destination Feature Type Definition
Pattern 1Central Workflow Pattern • Don’t do this!
Pattern 1Central Workflow Pattern • Do This!
Pattern 2External 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 AttributeRenamer and AttributeCopier • 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!
Pattern 2External Attribute Schema Map • 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 destination_attribute min_road_id ID name Name road_type Road_Type • The external attribute schema map definition can be defined in a number of tabular formats, e.g. Excel, CSV, Access, Oracle, MySQL etc. FME Workbench
FME SchemaMapper 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
Pattern 3External 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!
FME Workbench Pattern 3External Attribute Value Map • 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 Carriage_Type Dual Carriage Divided Highway Single Carriage Divided Road Single Track Undivided Road • The external attribute value schema map definition can be defined in a number of tabular formats, e.g. Excel, CSV, Access, Oracle, MySQL etc.
Pattern 4External 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, MapInfo has limited style support and AutoCAD 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
FME Workbench Smallworld CST Pattern 4External Style Metadata Map
Pattern 5Bookmarks • 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
Pattern 6FME 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
Pattern 7FME 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
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