Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

What are the examples of Chain of Responsibility design pattern in JDK?

Pragya Keshap answered on February 10, 2023 Popularity 7/10 Helpfulness 1/10

Contents


More Related Answers

  • What is a Chain of Responsibility pattern? In what scenarios to apply this pattern?
  • 17. Can you explain the Chain of Responsibility design pattern in Java?
  • java chain of responsibility
  • What are the design patterns involved in JDBC architecture?
  • Chained or Chain of Responsibility Pattern
  • What are the examples of Visitor design pattern in JDK?
  • Chain of Responsibility Pattern
  • chain of responsibility design pattern

  • What are the examples of Chain of Responsibility design pattern in JDK?

    0

    In JDK there are many places where Chain of Responsibility design

    pattern is used. Some of these are as follows:

    1. java.util.logging.Logger.log(): In this case Logger class

    provides multiple variations of log() method that can take

    the responsibility of logging from client in different

    scenarios. The client has to just call the appropriate log()

    method and Logger will take care of these commands.

    2. javax.servlet.Filter.doFilter(): In the Filter class, the

    Container calls the doFilter method when a

    request/response pair is passed through the chain. With

    filter the request reaches to the appropriate resource at the

    end of the chain. We can pass FilterChain in doFilter()

    method to allow the Filter to pass on the request and

    response to the next level in the chain.

    https://www.digitalocean.com/community/tutorials/chain-of-responsibility-design-pattern-in-java

    Popularity 7/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 10 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.