Date post: | 21-Nov-2014 |
Category: |
Technology |
Upload: | ant-phillips |
View: | 4,464 times |
Download: | 5 times |
© 2012 IBM Corporation2
The Challenge
From:MQ
File
WSDL
To:
© 2012 IBM Corporation3
Patterns for Simplified Development
Creates top-down, parameterized connectivity solutions
Reduces common problems in flow development
Establishes best practices for healthcare integration
Reduces time-to-value for solution development
Patterns are easily extended with regular broker functionality
© 2012 IBM Corporation
Pattern Generation
4
Pattern generation creates the production ready Message Broker projects– Generated projects reflect the configuration choices of the pattern user– Configuration is saved so that the pattern can be re-generated if required
© 2012 IBM Corporation
Built-In Patterns
Message Broker provides a core set of built-in patterns
These implement a variety of common scenarios– Web service front end to a MQ based application– Processing data stored in a file and routing to one or more queues– Adding a proxy in front of a web service provider– Processing data from an SAP system and routing to MQ– Shredding messages and routing to one or more queues
Patterns are selected based on client feedback and field experience
This core set of patterns continues to grow with each release
5
© 2012 IBM Corporation
Pattern Authoring
© 2012 IBM Corporation7
Pattern Authoring
Patterns and pattern authoring are first class concepts
Pattern authoring is a design activity– It may be long lived– It is often not sequential
We always start with a working solution - one or more Broker projects
Using patterns is a top-down activity driven by a requirement, but:– Authoring a working solution is (typically) a bottom-up activity– So pattern authoring must bridge these two different approaches
Patterns have their own development cycle
Creating the working solution is part of the pattern authoring process
© 2012 IBM Corporation
Pattern Authoring Workflow
8
© 2012 IBM Corporation
Developing the Solution
9
© 2012 IBM Corporation
Create Your Working Solution
10
No change at all - design your Message Broker solution as you do today– Pattern authoring does not change the tools you use to create solutions– The key to creating a good pattern is to create a good working solution!
© 2012 IBM Corporation
Define Your Target Properties
11
© 2012 IBM Corporation
Pattern Authoring Workflow
12
© 2012 IBM Corporation
Select Your Files and Resources
13
Selects the projects and files which the pattern will include– Clicking on a message flow displays any target properties in that file– Patterns can include many different types of Message Broker projects
© 2012 IBM Corporation
Configure Your Pattern Parameters
14
Pattern parameters prompt information from pattern users– Pattern groups organise parameters into related areas– Parameters map to target properties in the message flows
© 2012 IBM Corporation15
Pattern Parameters and Groups
Add field prompts and help information to pattern parameters and groups:
© 2012 IBM Corporation16
Refine Your User Interface
Refine the pattern user interface by using the specialist field editors– Add XPath expressions to control when a pattern parameter is required– Enumerations allow you to present a well defined list of options to a pattern user
© 2012 IBM Corporation
Add Your Pattern Categories
17
User-defined categories are displayed in the Patterns Explorer– Use the built-in categories or add your own pattern categories– Categories include a description authored in regular HTML– Easy to add style sheets, images and any other files as required
© 2012 IBM Corporation
Test Your Pattern
18
© 2012 IBM Corporation
Test Your Pattern
19
Click Test Pattern and a second workbench is started ready for testing– Extra metadata can also be configured such as version number and vendor name– Patterns are implemented by plug-ins which are created in your workspace
© 2012 IBM Corporation
Pattern Refinement
© 2012 IBM Corporation
Overview
Pattern authoring in Message Broker supports property changes– Node, user-defined properties (UDPs) and promoted node properties
Property variability is the most common type of variability that a pattern might need to express - there are many others:
– Generate application text files such as ESQL scripts– Make structural changes to Message Flows– Create administration files such as MQSC scripts
It is impossible to try and predict all the possible extensions that a pattern author might wish to implement
In Message Broker we provide two ways to extend pattern authoring– Java code that is invoked when pattern instances are generated– PHP templates that generate text files in pattern instance projects
21
© 2012 IBM Corporation
Java and PHP code
Easy to attach Java code and PHP templates to a pattern– Code is invoked in top down order as shown in the Pattern Authoring editor
22
© 2012 IBM Corporation
The MessageFlow API contains all the nodes, connections and artefacts present in the message flow
The Message Flow API includes properties, nodes and connections– This is not an exhaustive list – essentially equivalent to the Message Flow editor
User Defined Nodes are represented as GenericNode
23
Message Broker API
© 2012 IBM Corporation
PHP
PHP is a general purpose dynamic scripting language
Easy to use with a gentle learning curve
Efficient syntax and library have evolved in open source–Community driven to get more done in less time–Impressive results with little code–Extensive library support–Language well suited to rapid prototyping
More than 3 million developers worldwide
4th most populate language after Java, C and Visual Basic
Message Broker PHP Compute Node since v6.1.0.4– Java implementation, fully compliant with PHP version 5.2
24
© 2012 IBM Corporation
PHP Templates
25
Output from PHP template is written straight to the generated project
© 2012 IBM Corporation
Pattern Communities
© 2012 IBM Corporation
Distribute Your Pattern
27
© 2012 IBM Corporation
Pattern Communities
Pattern authoring creates patterns whose value multiplies as they are shared and used by a community of developers
Public and private communities are equally interesting!
A community needs to offer more than just a repository of assets!– Space for content such as patterns and subflow nodes– Forums to host discussions and threaded conversations– Categorisation is important as the community grows! (taxonomies)– Essential administrative functions such as user management– News articles and broadcasts keep the site fresh
There are literally dozens of content management systems available
On the commercial side we have tried Lotus Connections and Rational Asset Manager
Open source projects such as Drupal and Joomla are compelling!
28
© 2012 IBM Corporation
Packaging a Pattern
29
© 2012 IBM Corporation
Pattern Archives
The goal is to simplify the packaging and distribution of patterns
Creating Eclipse update sites and features is a fairly complex task
Code projects are automatically packaged and distributed
A pattern archive contains the pattern plug-ins and an Eclipse feature– The version of the feature matches the pattern version:
30
© 2012 IBM Corporation
Creating a Community Space
31
© 2012 IBM Corporation
A Shared Repository for Patterns
32
© 2012 IBM Corporation
Drupal
The demonstration system is a standard Drupal v6 install– Drupal is a PHP-based open-source content management system (CMS)– A key strength of Drupal is its vibrant community of users and developers– Drupal has an extensive list of many hundreds of add-on modules
The following contributed modules were installed:– Voting is provided by FiveStar and VotingAPI modules – Site search is configured (this is a built in module) – An easy to use Administration module is available – Pages based around an image are provided by the Image module – Categorisation of content made available by the Taxonomy module
It took just over one hour to complete the system set up!
33
© 2012 IBM Corporation
Community Branding
34
© 2012 IBM Corporation
Install Your Pattern
35
© 2012 IBM Corporation
Installing Patterns
The Pattern Explorer provides a download capability for pattern archives
Pattern archives can be installed from a local file system or from a URL
HTTP/S is not supported – instead login, download and install from the file system
Installation completes without a toolkit restart
Patterns are uninstalled through the Eclipse updates feature: Help > Software Updates
.patternzip files can also be double clicked which runs an installer application (the file extension is registered by the toolkit)
36
© 2012 IBM Corporation
Bringing It All Together!
© 2012 IBM Corporation
Microsoft .NET Service Enablement
38
How quickly can you build a web service using a .NET application?
– Creating a service where one doesn’t currently exist is service enablement
– Excellent opportunity to show case new features in Message Broker
• Applications and libraries, deployable WSDL/XSD, Pattern Authoring enhancements
© 2012 IBM Corporation
Configuring the Microsoft .NET Assembly
39
User-defined editor allows the pattern user to select their .NET assembly
– Selection proceeds to a class and the (static) methods available in that class
– Assembly can be developed in any .NET language (for example, VB.NET or C#)
– Return value and parameters are reflected on and displayed by the user-defined editor
© 2012 IBM Corporation
Projects Generated by the Pattern
40
The pattern generates an application and a library
– Application contains the mechanics of the pattern instance
– Library contains subflows for user customizations
– Customizations are never deleted on re-generation!
WSDL created to represent the selected .NET methods
– One WSDL operation for each .NET (static) method
– Likewise one message part defined per operation
– WSDL types are defined in a separate XML schema file
– WSDL and XSD are deployed directly to Message Broker
© 2012 IBM Corporation
Microsoft .NET Data Types
41
CLR Data Type(System.*)
XSD (WSDL) ESQL
Int32 xsd:integer INT
Int64 xsd:long INTEGER
Decimal xsd:decimal DECIMAL
Double xsd:float FLOAT
Byte[] xsd:hexBinary BLOB
String xsd:string CHARACTER
Char xsd:string CHAR
Boolean xsd:boolean BOOLEAN
DateTimeOffset xsd:dateTime TIMESTAMP
TimeSpan xsd:time TIME
DateTime xsd:dateTime GMTTIMESTAMP
The table shows the mapping from .NET data types to ESQL and XSD Value types declared as Nullable<> are also supported (relevant for value types)
© 2012 IBM Corporation
Pattern Design Points
Methods must be static, public and visible to be eligible for inclusion– Intention is to also support .NET instance methods by creating objects
No method overloading is currently supported by the pattern– Choose one method which is sufficient for the service definition
One class per service – create a wrapper class for aggregation
Exceptions thrown by.NET are returned as regular SOAP faults
42