Skip to content

frkn2076/Adapter-Pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Adapter Pattern

A Simple Implementation Of Adapter Pattern Usage

Prerequisites

Have the knowledge of object-oriented programming.

Main Idea of the Adapter Pattern

The Adapter pattern is a structural pattern which allows incompatible interfaces to work together. By doing so, we allow objects from different interfaces to exchange data.

What is the Problem Require the Adapter Pattern

Consider we get xml data from a source (called XmlSource.cs in project) and send it to a service (called MyService.cs in project) to print this data. Now, we need to send this data in json format. By the way, we can't do anything about source (SourceXml.cs) and destination (MyService.cs) files since sometimes our destination requires xml data.

There is a best practice solution for these problems and this one called as Adapter Pattern :)

Have a look at my project for more detailed review.

I've tried to explain as short as possible. I hope everything is clear :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages