Skip to main content


developerWorks  >  Rational  >

Pattern Solutions

Use patterns to drive productivity in software design and development

developerWorks
OverviewAssetsEducationQuick startResources/Community

Patterns development process
Patterns implementation: Frameworks
Pattern implementation: Choosing a framework
Model output: RSx patterns and transforms
Text output: DPTK /JET2
Packaging and deploying
Applying patterns




Patterns development process

The following steps outline the patterns development process.

Analyze the target domain

Identify the context, examine the recurring problem, and find a recurring exemplar solution. A solution to a more complicated problem may involve multiple patterns. Analyze the target domain to get a clear definition of inputs, outputs (what you are trying to produce), and points of variability (what input should be left to the user and what should the pattern provide). Patterns describe things that have been done before, so gather real examples of the deliverables you want to produce and the best practices.

Design the recipe

Determine the best solution to the problem and a natural and realistic entry point for design. Figure out what information is available at the start and what is needed at each stage. Create an outline of what will happen in each stage.

Implement patterns

At this point you have a set of design activities defined and know the information content at the entry point and exit points. For each pattern there is a pattern implementation, a type of micro-tool, that can be created to drive individual pattern applications. An invocation environment needs to be established to provide mechanisms that will configure, trigger, and execute applications of the pattern. A key decision point to the pattern implementation is determining whether output will be presented as a model or as text.

Package and deploy

Once the pattern implementation is developed, results need to be packaged for distribution, along with documentation suitable for the intended user community. The use of the Reusable Asset Specification (RAS) should be considered in conjunction with the use of a RAS repository.


patterns development process figure

Back to top



Patterns implementation: Frameworks

The choice of technology for a pattern implementation is dependent on the characteristics of the inputs and outputs. The goal is to produce a set of solution artifacts (Java source files, XML files, etc.), using an input model (UML model, XML schema instance, etc.) to guide the customization of the generated artifacts. This goal is often approached incrementally with successive "apply pattern" steps producing intermediate models that are closer to the final solution.


patterns development process figure

Patterns are by nature technology independent, so there is no restriction on the technologies that could be used to implement a pattern. The vision is to build micro-tools that can be:

  • Reused across communities
  • Distributed as reusable assets and hosted in repositories
  • Easily integrated into the overall development environment and will work well with other tools

A number of meta-tooling technologies are available to suit different requirements.

Design Pattern Toolkit (DPTK)/JET2

  • Template engine for generating applications based on customizable, "model to text" transformations
  • Features exemplar analysis tools, template editor

Find out more about Design Pattern Toolkit (DPTK)/JET2.

Rational software design and construction tools (RSx)

Rational Software Architect and Rational Software Modeler (RSx) build on an Eclipse base to provide a rich environment for more specialized pattern-based micro-tool development. Rational Software Architect provides built-in frameworks that bring automation to design and construction.

  • Rational Software Architect Patterns Framework: Author patterns by easily defining the pattern, the pattern parameters, and implementing the code. Applying patterns in a single model and within the same level of abstraction is easy and done visually through drag, drop, and binding pattern arguments. Rational Software Architect also provides the Pattern Explorer View, which allows you to connect to other pattern repositories to import additional patterns.
  • Rational Software Architect Transform Framework: Author your own transform. Transforms differ from patterns in that transforms are applied across metamodels, models, and different levels of abstractions and transform into other artifacts (code, script, other models). Rational Software Architect includes transforms for you to extend (UML to Java, UML to EJB, Java to UML).
  • Pluglets, modeling framework, RAS framework

Find out more about software development tools from Rational.


Back to top



Pattern implementation: Choosing a framework

Inputs are typically treated as models. In cases where a text file without a corresponding model must be used as an input, it will need to be parsed first and placed into an appropriate model. The key decision point is determining what artifacts or outputs the pattern implementation will generate.

  • Model: Modifies the input model or generates a new model from the input model
  • Text: Generates artifacts such as code, scripts, descriptors, data files from the input model

Pattern Implementation Decision Tree

Back to top



Model output: RSx patterns and transforms

If your pattern implementation generates output as UML model:

Use RSx patterns and transforms

  • Use RSx patterns with simple, interactive, drag-and-drop, graphical interface for your pattern if in-place pattern expansion, where the problem and solution domains are the same UML model. Used to add details to a model.
  • Use RSx transformations if input parameters can't be represented in the RSx Patterns framework or if performing other model-to-model patterns across models or metamodels. RSx transformations can create more detailed software artifacts from more abstract artifacts in a standard way (including UML to UML, UML to Java, UML to EJB).

RSx Framework View image

Alternatives to using RSx

Use the productivity tools in RSx wherever possible. Consider these options if the use of RSx is not possible:

  • When text file input is acceptable, use IBM's Design Pattern Tool Kit (DPTK)/Java Emitter Templates (JET). (JET2 is a new set of features from DPTK available in Eclipse 3.2.)
  • If graphical modeling capability is required, add Graphical Modeling Framework (GMF)/Eclipse Modeling Framework (EMF). Graphical model editing is more complex than a text-based approach and benefits from the productivity features available in RSx.

Additional resources


Back to top



Text output: DPTK /JET2

If your pattern implementation generates output as text:

Use DPTK/JET2 patterns and transformations

  • RSx transformations support Model2Text but is not recommended due to complexity and doesn't facilitate reuse. Use RSx with JET1 when DPTK is not acceptable.
  • By default, artifacts should be treated as text (rather than models) and generated/manipulated with JET2.
  • If your input model is already in text form, or in form of an EMF model already close to that required by the transform, choose JET2.
  • If the input model is UML or an EMF model with significant content not required by the transform, then develop an RSx transform to extract the appropriate information from the input model into an intermediate text or EMF model which directly matches the transform requirements, and use JET2.

This image shows a DPTK/JET2 framework view.
DPTK/JET2 Framework View figure

Here you can see a DPTK/JET2 code view.
DPTK/JET2 Code View figure

Additional resources


Back to top



Packaging and deploying

Reusable Asset Specification assets

An important aspect of patterns development is a standard way to organize, describe, and package assets. The Reusable Asset Specification (RAS), adopted as an OMG standard in 2004, defines a standard way to describe and package reusable software assets. A reusable asset provides a solution to a problem for a given context and can have variability points that can be customized by the asset consumer.

Every reusable asset must contain:

  • A manifest file
  • One of more artifacts

Artifacts can be:

  • Models, source code, scripts
  • Documents, deployment descriptors
  • Test cases

A good asset should have:

  • Variability points
  • Customizable by asset consumers

RAS is extensible

  • Using specialized profiles

Additional resources

Rational Software Architect

Rational Software Architect lets you package assets as a RAS asset to browse, search, import, and export assets stored in RAS asset repositories.


Back to top



Applying patterns

Use Rational® Software Architect to connect to the RAS repository hosted on developerWorks.
newrepositorycon

DPTK/JET2 Code View figure

newrepositorycon2

Use Asset Explorer to browse the assets that are in the developerWorks repository. Locate and import the patterns asset that you want to apply.
assetsexplorer.JPG

Select the pattern from Pattern Explorer.
patternexplorer

Create a UML model, apply one or more patterns, and specify pattern parameters.
patternparameters

Run a transformation to convert models into artifacts (code, scripts, docs).
modelquery

Back to top


 logo

Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community


developerWorks spaces
Learn, collaborate, and lead the way

Spotlight
Meet the experts: Submit your questions on model-driven development
Patterns designed to deliver the message
IBM publishes Enterprise Service Bus patterns

Latest articles
Model-driven and pattern-based development using Rational Software Architect, Part 2: Model-driven development tooling support in IBM Rational Software Architect
Content record for: Model-driven and pattern-based development using Rational Software Architect, Part 2: Model-driven development tooling support in IBM Rational Software Architect
Build ESB connectivity with RSA WebSphere Platform Messaging Patterns
Build J2EE applications with IBM Rational Software Architect Enterprise Patterns
Top 10 J2EE best practices

Special offers
Dynamic  infrastructure for software delivery
Automate processes to the Web with Lotus Forms
Learn to design an ESB Gateway

More offers