Design Pattern Used In JDK

Connect with

Behavioral Patterns

Chain of Responsibility: It avoids attaching the sender of a request to its receiver, giving this way other objects the possibility of handling the request too.
– The objects become parts of a chain and the request is sent from one object to another across the chain until one of the objects will handle it.

Used in jdk:

  • java.util.logging.Logger#log()
  • javax.servlet.Filter#doFilter()

Memento: capture the internal state of an object without violating encapsulation and thus providing a mean for restoring the object into initial state when needed.

Used in jdk:

java.util.Date (the setter methods do that, Date is internally represented by a long value)

  • All implementations of java.io.Serializable
  • All implementations of javax.faces.component.StateHolder

Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *