architect-handbook

Software Architect Handbook

View on GitHub

Remote Facade

Provides a coarse-grained facade on fine-grained objects to improve efficiency over a network.

Overview

Remote calls are expensive: data may have to be marshaled, security may need to be checked, packets may need to be routed through swithces. Any inter-process call is orders of magnitude more expensive than an in-process call, even if both processes are on the same machine.

As a result, any object that’s intended to be used as a remote object needs a coarse-grained interface that minimizes the number of calls needed to get somethind one.

A Remote Facade provides a coarse-grained facade over a web of fine-grained object. None of the fine-grained objects have a remote interface, and the Remote Facade contains no domain logic, all it does is translate coarse-grained methods onto the underlying fine-grained objects.

How It Works

When to Use It