0
0
LLDsystem_design~12 mins

Encapsulation and information hiding in LLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Encapsulation and information hiding

This system demonstrates encapsulation and information hiding in software design. It shows how internal details of a module are hidden from users, exposing only necessary interfaces. The goal is to protect data integrity and reduce complexity for users.

Architecture Diagram
  +------------+       +----------------+       +------------+
  |   Client   | ----> |  Public API     | ----> | Internal   |
  | (User)    |       |  (Interface)    |       | Module     |
  +------------+       +----------------+       +------------+
                                   |                    |
                                   |                    v
                                   |             +------------+
                                   |             | Private    |
                                   |             | Data &     |
                                   |             | Methods    |
                                   |             +------------+
Components
Client
user
Sends requests to the system using the public interface
Public API
interface
Exposes only necessary methods to the client, hides internal details
Internal Module
module
Contains core logic and data, not directly accessible by client
Private Data & Methods
data_store
Stores sensitive data and helper functions hidden from client
Request Flow - 5 Hops
ClientPublic API
Public APIInternal Module
Internal ModulePrivate Data & Methods
Internal ModulePublic API
Public APIClient
Failure Scenario
Component Fails:Public API
Impact:Client cannot access any functionality since the public interface is down
Mitigation:Implement redundancy or fallback interfaces to maintain availability
Architecture Quiz - 3 Questions
Test your understanding
Which component hides the internal data and methods from the client?
AInternal Module
BClient
CPublic API
DPrivate Data & Methods
Design Principle
This architecture shows encapsulation by exposing only a public interface to clients while hiding internal data and methods. It protects data integrity and simplifies client interaction by information hiding.