Design Patterns - Facade Pattern

Facade Design Pattern | Introduction

Facade is a part of Gang of Four design pattern and it is categorized under Structural design patterns. Before we dig into the details of it, let us discuss some examples which will be solved by this particular Pattern.

So, As the name suggests, it means the face of the building. The people walking past the road can only see this glass face of the building. They do not know anything about it, the wiring, the pipes and other complexities. It hides all the complexities of the building and displays a friendly face.

In Java, the interface JDBC can be called a facade because, we as users or clients create connection using the “java.sql.Connection” interface, the implementation of which we are not concerned about. The implementation is left to the vendor of driver.

Another good example can be the startup of a computer. When a computer starts up, it involves the work of cpu, memory, hard drive, etc. To make it easy to use for users, we can add a facade which wrap the complexity of the task, and provide one simple interface instead.


要查看或添加评论,请登录

Kevin zhou的更多文章

  • Talking more about AutowiredAnnotationBeanPostProcessor

    Talking more about AutowiredAnnotationBeanPostProcessor

    AutowiredAnnotationBeanPostProcessor object is used to dynamically place objects that depend on the dependent object…

  • Spring – BeanFactory

    Spring – BeanFactory

    The first foremost thing when we talk about spring is dependency injection which is possible because spring is actually…

  • Difference Between BeanFactory and ApplicationContext

    Difference Between BeanFactory and ApplicationContext

    1. Overview The Spring Framework comes with two IOC containers – BeanFactory and ApplicationContext.

  • SOLVING THE N+1 PROBLEM IN ORMS

    SOLVING THE N+1 PROBLEM IN ORMS

    SOLVING THE N+1 PROBLEM IN ORMS THE N+1 PROBLEM ORMs are tools that write SQL requests for you. Because you use a nice…

  • How I Accidentally Built an API Business

    How I Accidentally Built an API Business

    In this article, I’ll share my journey of building an API business, the technology behind it, and how to build your own…

  • How I Learned to Code and Built a Real Software Product in 6 Months

    How I Learned to Code and Built a Real Software Product in 6 Months

    On May 21st, 2020 I wrote my first-ever line of code as part of Harvard’s CS50 online course. I was a 30 year old with…

    1 条评论
  • How to Convert PDF to Images with Imagemagick

    How to Convert PDF to Images with Imagemagick

    How to Convert PDF to Images with Imagemagick In this post, I want to share how to accomplish this task with…

    1 条评论
  • Advantages of ERP

    Advantages of ERP

    Advantages of ERP Now that we’ve cleared up some misconceptions, it’s time to move onto why companies all around the…

  • Configure postfix as relay for macOS Sierra

    Configure postfix as relay for macOS Sierra

    Configure postfix as relay for macOS Sierra Source: https://www.developerfiles.

  • How to Register & Use Laravel Service Providers

    How to Register & Use Laravel Service Providers

    If you've ever come across the Laravel framework, it's highly unlikely that you haven't heard of service containers and…

社区洞察