Chapter 5. Integration Design Patterns in OpenWhisk

We have already explored some of the common and built-in patterns in OpenWhisk, which are useful for implementing single actions. In this chapter, we’ll explore patterns that are useful for integrating different actions and interacting with users. We continue the implementation of some classical “Gang of Four” design patterns and also cover the ubiquitous Model-View-Controller pattern implemented for OpenWhisk.

In Figure 5-1 we can see the patterns covered in this chapter and the previous chapter:

  1. Singleton

  2. Facade

  3. Prototype

  4. Strategy

  5. Chain of Responsibility

  6. Command

  7. Bridge

  8. Proxy

  9. Adapter

  10. Observer

  11. Composite and Visitor

  12. MVC

laow 0501
Figure 5-1. A contact form example covering many design patterns
Tip

The source code for the examples of the design patterns (this chapter and the previous chapter) are available in the GitHub repository.

Integration Patterns

In this section we discuss the patterns commonly used to connect different systems. These include:

Proxy

Used when you want to keep the same interface to a system but change the details at the implementation level

Adapter

Used for adapting requests from one interface to a system to another.

Bridge

Used when you want to define a common generic interface to a class of systems and then specify different implementations for each case

Observer

Used when you ...

Get Learning Apache OpenWhisk now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.