Chapter 6. Working with components and patterns

 

This chapter covers

  • How to use a Mule component
  • Simplifying projects using configuration patterns

If you’ve been around for a little while in the happy field of software development, you’ve surely been exposed to different flavors of component models. CORBA, EJB, JavaBean, and SCA have all helped to familiarize developers with the notion of a component. You understand that components represent entities that can perform specific operations, with well-defined interfaces and an emphasis on encapsulation.

Unsurprisingly, Mule supports its own component model. More surprisingly, it’s often difficult to decide when to use or create a component in Mule. This difficulty stems from the extensive capacities of the routing, filtering, and transforming infrastructure that surrounds the components. The previous chapters have explored these capacities; you’ve discovered that you can achieve many complex integration scenarios without the need for any particular component. Why bother about components? In this chapter, we’ll start by answering that question. Then you’ll learn how to reuse your existing components, how to use component annotations, and how to use scripting languages to write components. We’ll also look closely at Prancing Donkey’s requirements for a shipping cost calculator using lifecycle methods and the addition of an MD5 signature to messages using scripting components.

6.1. Using Mule components

6.2. Simplifying configuration with configuration patterns

6.3. Summary