...

/

Facade: Implementation and Example

Facade: Implementation and Example

Learn the Facade design pattern by implementing an example program.

Implementing the Facade design pattern

Let’s imagine that we need to build an application where, if we input the account name, we’re able to retrieve the list of products this account is allowed to buy. To achieve this, we’ll have to deal with multiple back-end systems. A list of products will be returned based on which category the account belongs to and whether or not the account is a buyer or a reseller. However, our application doesn’t hold this information. There’s another service that’ll return the account category based on the account ID. The problem is that our application doesn’t store the account ID either. It operates within its own bounded context where account id doesn’t exist. Only the ...