Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Adapter Pattern for Service Interfaces #3

Open
isaiasgh opened this issue Jul 30, 2024 · 0 comments
Open

Implement Adapter Pattern for Service Interfaces #3

isaiasgh opened this issue Jul 30, 2024 · 0 comments

Comments

@isaiasgh
Copy link

Implement Adapter Pattern

Objective

The Adapter pattern converts the interface of a class into another interface that the client expects. The Adapter allows classes that could not work together due to incompatible interfaces to collaborate.

Motivation

In the context of your system, you have different services (Laundry and Transportation) with specific interfaces. By using the Adapter pattern, you can provide a common interface (Service) for these services, allowing them to be used uniformly and simplifying the client code that interacts with these services.

Advantages

  • Facilitates collaboration between classes with incompatible interfaces.
  • Allows reuse of existing code with non-matching interfaces.
  • You can add new adapters for new classes without modifying the client code.

Attachments

  • UML Solution

adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant