21
Design Patterns 1 FME UC 2007 Design Patterns FME Workbench

Design Patterns 1 FME UC 2007 Design Patterns FME Workbench

Embed Size (px)

Citation preview

Design Patterns 1

FME UC 2007

Design PatternsFME Workbench

Design Patterns 2

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 3

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 4

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 5

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

Design Patterns 6

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

FME Workbench

Source Feature 1

Source Feature 2

Source Feature...N

Single Point of Entry Feature Type Filter

Destination Feature 1

Destination Feature 2

Destination Feature .. N

Central Workflow

Design Patterns 7

Pattern 1Central Workflow Pattern

Don’t do this!

Design Patterns 8

Pattern 1Central Workflow Pattern

Do This!

Design Patterns 9

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!

Design Patterns 10

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_attributemin_road_id IDname Nameroad_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.

Source Feature 1

Source Feature 2

Source Feature...N

Schema Mapper Feature Type Filter

Destination Feature 1

Destination Feature 2

Destination Feature .. N

Attribute 1Attribute 2Attribute ... N

Attribute AAttribute BAttribute ... N

External Attribuite SchemaMap Definition

FME Workbench

Design Patterns 11

Pattern 2External Attribute Schema

Map

Design Patterns 12

Pattern 2External Attribute Schema

Map

Design Patterns 13

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

Design Patterns 14

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!

Design Patterns 15

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_TypeDual Carriage Divided HighwaySingle Carriage Divided RoadSingle 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.

FME WorkbenchSource Feature 1

Source Feature 2

Source Feature...N

Joiner Feature Type Filter

Destination Feature 1

Destination Feature 2

Destination Feature .. N

Source Value

External Attribuite Value MapDefinition

Destination Value

Design Patterns 16

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

Design Patterns 17

Pattern 4External Style Metadata Map

Smallworld CST FME Workbench

Source Feature 1

Source Feature 2

Source Feature...N

Feature TypeFilter

Destination Feature 1

Destination Feature 2

Destination Feature .. N

Attribute 1Attribute 2Attribute ... N

Meta Attribute AMeta Attribute BMeta Attribute ... N

External Style Metadata MapDefinition

FME Plugin

Style MappingWorkflow

TCP/IP

TICS

Pseudo Attribute 1Pseudo Attribute 2Pseudo Attribute ... N

RWO .. N

RWO 1

RWO 2

Design Patterns 18

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

Design Patterns 19

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

Design Patterns 20

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

Design Patterns 21

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