Skip to main content

Summary

In this chapter, we presented the aspect-oriented implementation of five well-known design patterns: Singleton, Observer, Command, Chain of Responsibility, and Proxy.

For these five cases, the implementation follows this principle: an abstract aspect is defined to hold the code that is generic in the implementation of the pattern. This abstract aspect defines abstract pointcuts that designate the locations in the program where the pattern is to be integrated and the conditions under which the pattern must be triggered. This abstract aspect is then extended to define the code, which is specific to, for example, a command or a proxy.

The aspect-oriented implementations of these five design patterns lead to solutions that are more interesting than pure object-oriented, aspect-free implementations. It is, however, not the case for all existing design patterns. Patterns such as the Factory pattern or the Inter- preter pattern do not benefit as much from aspects.

Deciding whether a design pattern will benefit from an aspect-oriented implementation is a matter of evaluating whether

  • • The pattern defines a crosscutting structure.

  • • The four criteria of locality, reusability, composition transparency, and (un)pluggability defined by Hannemann and Kiczales are met.

  • • The pattern leaves the structure of the base program unchanged.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 54.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Renaud Pawlak, Lionel Seinturier, and Jean-Philippe Retaillé

About this chapter

Cite this chapter

(2005). Design Patterns and AOP. In: Foundations of AOP for J2EE Development. Apress. https://doi.org/10.1007/978-1-4302-0063-5_8

Download citation

Publish with us

Policies and ethics