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

What are the examples of Mediator design pattern in JDK?

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

Contents


More Related Answers

  • What are the design-patterns used in Spring framework?
  • What are the design patterns involved in JDBC architecture?
  • Template Design Pattern In java
  • What are some of the design patterns used in Java’s JDK library?
  • What is Template Method design pattern in Java?
  • What are the examples of Builder design pattern in JDK?
  • What are the examples of Decorator design pattern in JDK?
  • What are the examples of Command design pattern in JDK?
  • What are the examples of Visitor design pattern in JDK?
  • What are the examples of Adapter design pattern in JDK
  • mediator pattern in design pattern

  • What are the examples of Mediator design pattern in JDK?

    0

    By using Mediator pattern we can decouple the multiple objects that

    interact with each other. With a Mediator object we can create

    many-to-many relationships in multiple objects.

    In JDK there are many places where Mediator design pattern is

    used. Some of these are as follows:

    java.util.Timer: schedule() methods in Timer class act as

    Mediator between the clients and the TimerTask to be

    scheduled.

    java.util.concurrent.Executor.execute(): The execute()

    method in an Executor class acts as a Mediator to execute

    the different tasks.

    java.util.concurrent.ExecutorService

    java.lang.reflect.Method.invoke(): In Method class of

    reflection package, invoke() method acts as a Mediator.

    java.util.concurrent.ScheduledExecutorService: Here also

    schedule() method and its variants are Mediator pattern

    implementations.

    https://www.digitalocean.com/community/tutorials/mediator-design-pattern-java

    Popularity 2/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: java mediator
    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.