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

Open-Closed Principle

Pragya Keshap answered on January 19, 2022 Popularity 10/10 Helpfulness 4/10

Contents


More Related Answers

  • . What is Open/closed design principle in Software engineering?
  • What is the Open closed design principle in Java?
  • Open-Closed Principle (OCP):
  • What do you understand by the Open-Closed Principle (OCP)?
  • SOLD Open Closed Principle

  • Open-Closed Principle

    3

    When you write your code, the last thing you want to do is go back to it and change it again and again whenever you implement a new functionality. You want the legacy code to work, be tested to work, and allow new functionality to be built on top of it.

    In the same way, when we design the system, it should able to extend without changing existing architecture. For example using pub/sub pattern with message brokers is a good example for that. If we want to notify some other microservices, instead of calling their services, we can publish an event and they can consume them from message broker.

    By this way, if there will be a new microservice need to consume this event, we don’t change anything for existing architecture, the only thing to subscribe that event from message broker that’s all. So our design open for extensions and close for modifications.

    PUBSUB Model is very good example

    Popularity 10/10 Helpfulness 4/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on Mar 01 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    6
    Popularity 10/10 Helpfulness 4/10 Language whatever
    Source: deviq.com
    Link to this answer
    Share Copy Link
    Contributed on Jan 19 2022
    ruperto2770
    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.