SlideShare a Scribd company logo
1 of 1
Download to read offline
Suppose you have an existing application that uses a database to store and retrieve data. The
application is built using an interface called IDatabase, which has methods: connect,
executeQuery, and disconnect. Example usage:
Now, you want to add a new feature to the application that requires data to be fetched from a web
API. However, the web API has a different interface that you cannot change. It has methods:
openConnection, sendRequest, and closeConnection. Use Adapter Pattern to adapts the web API
to the IDatabase interface to fit the existing code without modifying it. Instructions: Choose either
C++ or Java You do not need to implement the real logic in the method body. It's ok to use pseudo
code. For example: public void openConnection() { some logic to open the connection} The focus
is not to have a running program but show each required piece of Adapter Pattern and how they
are connected. You can use a text editor instead of IDE to write the code. All classes can be put in
one file.

More Related Content

Similar to Adapter Pattern for Database and Web API Interface

How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...Appear
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...Appear
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web MahmoudOHassouna
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web MahmoudOHassouna
 
Spring Framework
Spring FrameworkSpring Framework
Spring Frameworknomykk
 
Spring Framework
Spring FrameworkSpring Framework
Spring Frameworknomykk
 
Codeigniter simple explanation
Codeigniter simple explanation Codeigniter simple explanation
Codeigniter simple explanation Arumugam P
 
Codeigniter simple explanation
Codeigniter simple explanation Codeigniter simple explanation
Codeigniter simple explanation Arumugam P
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
 
ASP.NET MVC Introduction
ASP.NET MVC IntroductionASP.NET MVC Introduction
ASP.NET MVC IntroductionSumit Chhabra
 
ASP.NET MVC Introduction
ASP.NET MVC IntroductionASP.NET MVC Introduction
ASP.NET MVC IntroductionSumit Chhabra
 
DataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptxDataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptxMularAbdulShukoor1
 
DataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptxDataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptxMularAbdulShukoor1
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S GuideAlicia Buske
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S GuideAlicia Buske
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCIan Carnaghan
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCIan Carnaghan
 

Similar to Adapter Pattern for Database and Web API Interface (20)

How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web Murach : How to develop a single-page MVC web
Murach : How to develop a single-page MVC web
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Codeigniter simple explanation
Codeigniter simple explanation Codeigniter simple explanation
Codeigniter simple explanation
 
Codeigniter simple explanation
Codeigniter simple explanation Codeigniter simple explanation
Codeigniter simple explanation
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVC
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVC
 
ASP.NET MVC Introduction
ASP.NET MVC IntroductionASP.NET MVC Introduction
ASP.NET MVC Introduction
 
ASP.NET MVC Introduction
ASP.NET MVC IntroductionASP.NET MVC Introduction
ASP.NET MVC Introduction
 
DataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptxDataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptx
 
DataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptxDataReader and DataAdapter using C# code.pptx
DataReader and DataAdapter using C# code.pptx
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
 
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5  Building Your First Web Application (A Beginner S GuideASP.NET MVC 5  Building Your First Web Application (A Beginner S Guide
ASP.NET MVC 5 Building Your First Web Application (A Beginner S Guide
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
 

More from actionindia2

Suppose you have the folowing class defintion for the object.pdf
Suppose you have the folowing class defintion for the object.pdfSuppose you have the folowing class defintion for the object.pdf
Suppose you have the folowing class defintion for the object.pdfactionindia2
 
Suppose you take two different samples of size 9 and 16 from.pdf
Suppose you take two different samples of size 9 and 16 from.pdfSuppose you take two different samples of size 9 and 16 from.pdf
Suppose you take two different samples of size 9 and 16 from.pdfactionindia2
 
Suppose you make a parswas a That consists of 6 chen 147.pdf
Suppose you make a parswas a That consists of 6 chen 147.pdfSuppose you make a parswas a That consists of 6 chen 147.pdf
Suppose you make a parswas a That consists of 6 chen 147.pdfactionindia2
 
Suppose X has the possible values 01234 Suppose that th.pdf
Suppose X has the possible values 01234 Suppose that th.pdfSuppose X has the possible values 01234 Suppose that th.pdf
Suppose X has the possible values 01234 Suppose that th.pdfactionindia2
 
Suppose you are assigned to develop a Mobile Financial Servi.pdf
Suppose you are assigned to develop a Mobile Financial Servi.pdfSuppose you are assigned to develop a Mobile Financial Servi.pdf
Suppose you are assigned to develop a Mobile Financial Servi.pdfactionindia2
 
Suppose you are interested in uncovering the relationship be.pdf
Suppose you are interested in uncovering the relationship be.pdfSuppose you are interested in uncovering the relationship be.pdf
Suppose you are interested in uncovering the relationship be.pdfactionindia2
 
Suppose you are indifferent between the investment in a taxa.pdf
Suppose you are indifferent between the investment in a taxa.pdfSuppose you are indifferent between the investment in a taxa.pdf
Suppose you are indifferent between the investment in a taxa.pdfactionindia2
 
Suppose Y1Y2Yn follow multivariate normal with mean 1 an.pdf
Suppose Y1Y2Yn follow multivariate normal with mean 1 an.pdfSuppose Y1Y2Yn follow multivariate normal with mean 1 an.pdf
Suppose Y1Y2Yn follow multivariate normal with mean 1 an.pdfactionindia2
 
Suppose XY have joint density function fXYxy53xy+y2.pdf
Suppose XY have joint density function fXYxy53xy+y2.pdfSuppose XY have joint density function fXYxy53xy+y2.pdf
Suppose XY have joint density function fXYxy53xy+y2.pdfactionindia2
 
Suppose XY have the joint probability density function gi.pdf
Suppose XY have the joint probability density function gi.pdfSuppose XY have the joint probability density function gi.pdf
Suppose XY have the joint probability density function gi.pdfactionindia2
 
Suppose you are elected to Federal Parliament of Australia a.pdf
Suppose you are elected to Federal Parliament of Australia a.pdfSuppose you are elected to Federal Parliament of Australia a.pdf
Suppose you are elected to Federal Parliament of Australia a.pdfactionindia2
 
Suppose X1Xn are iid random variables with mean EX an.pdf
Suppose X1Xn are iid random variables with mean EX an.pdfSuppose X1Xn are iid random variables with mean EX an.pdf
Suppose X1Xn are iid random variables with mean EX an.pdfactionindia2
 
Suppose there is a minieconomy with two people A and B A s.pdf
Suppose there is a minieconomy with two people A and B A s.pdfSuppose there is a minieconomy with two people A and B A s.pdf
Suppose there is a minieconomy with two people A and B A s.pdfactionindia2
 
Suppose we have a correctly working user program fragment L.pdf
Suppose we have a correctly working user program fragment L.pdfSuppose we have a correctly working user program fragment L.pdf
Suppose we have a correctly working user program fragment L.pdfactionindia2
 
Suppose we have a random sample of size n from a population .pdf
Suppose we have a random sample of size n from a population .pdfSuppose we have a random sample of size n from a population .pdf
Suppose we have a random sample of size n from a population .pdfactionindia2
 
Suppose the following data describe a nations population I.pdf
Suppose the following data describe a nations population I.pdfSuppose the following data describe a nations population I.pdf
Suppose the following data describe a nations population I.pdfactionindia2
 
Suppose the Queensland Government is considering establishin.pdf
Suppose the Queensland Government is considering establishin.pdfSuppose the Queensland Government is considering establishin.pdf
Suppose the Queensland Government is considering establishin.pdfactionindia2
 
Suppose three fair dice are rolled What is the probability .pdf
Suppose three fair dice are rolled What is the probability .pdfSuppose three fair dice are rolled What is the probability .pdf
Suppose three fair dice are rolled What is the probability .pdfactionindia2
 
Suppose the work on ObjectOriented Design starts with the .pdf
Suppose the work on ObjectOriented Design starts with the .pdfSuppose the work on ObjectOriented Design starts with the .pdf
Suppose the work on ObjectOriented Design starts with the .pdfactionindia2
 
suppose the prevalance P088 of type two diabetes follows .pdf
suppose the prevalance P088 of type two diabetes follows .pdfsuppose the prevalance P088 of type two diabetes follows .pdf
suppose the prevalance P088 of type two diabetes follows .pdfactionindia2
 

More from actionindia2 (20)

Suppose you have the folowing class defintion for the object.pdf
Suppose you have the folowing class defintion for the object.pdfSuppose you have the folowing class defintion for the object.pdf
Suppose you have the folowing class defintion for the object.pdf
 
Suppose you take two different samples of size 9 and 16 from.pdf
Suppose you take two different samples of size 9 and 16 from.pdfSuppose you take two different samples of size 9 and 16 from.pdf
Suppose you take two different samples of size 9 and 16 from.pdf
 
Suppose you make a parswas a That consists of 6 chen 147.pdf
Suppose you make a parswas a That consists of 6 chen 147.pdfSuppose you make a parswas a That consists of 6 chen 147.pdf
Suppose you make a parswas a That consists of 6 chen 147.pdf
 
Suppose X has the possible values 01234 Suppose that th.pdf
Suppose X has the possible values 01234 Suppose that th.pdfSuppose X has the possible values 01234 Suppose that th.pdf
Suppose X has the possible values 01234 Suppose that th.pdf
 
Suppose you are assigned to develop a Mobile Financial Servi.pdf
Suppose you are assigned to develop a Mobile Financial Servi.pdfSuppose you are assigned to develop a Mobile Financial Servi.pdf
Suppose you are assigned to develop a Mobile Financial Servi.pdf
 
Suppose you are interested in uncovering the relationship be.pdf
Suppose you are interested in uncovering the relationship be.pdfSuppose you are interested in uncovering the relationship be.pdf
Suppose you are interested in uncovering the relationship be.pdf
 
Suppose you are indifferent between the investment in a taxa.pdf
Suppose you are indifferent between the investment in a taxa.pdfSuppose you are indifferent between the investment in a taxa.pdf
Suppose you are indifferent between the investment in a taxa.pdf
 
Suppose Y1Y2Yn follow multivariate normal with mean 1 an.pdf
Suppose Y1Y2Yn follow multivariate normal with mean 1 an.pdfSuppose Y1Y2Yn follow multivariate normal with mean 1 an.pdf
Suppose Y1Y2Yn follow multivariate normal with mean 1 an.pdf
 
Suppose XY have joint density function fXYxy53xy+y2.pdf
Suppose XY have joint density function fXYxy53xy+y2.pdfSuppose XY have joint density function fXYxy53xy+y2.pdf
Suppose XY have joint density function fXYxy53xy+y2.pdf
 
Suppose XY have the joint probability density function gi.pdf
Suppose XY have the joint probability density function gi.pdfSuppose XY have the joint probability density function gi.pdf
Suppose XY have the joint probability density function gi.pdf
 
Suppose you are elected to Federal Parliament of Australia a.pdf
Suppose you are elected to Federal Parliament of Australia a.pdfSuppose you are elected to Federal Parliament of Australia a.pdf
Suppose you are elected to Federal Parliament of Australia a.pdf
 
Suppose X1Xn are iid random variables with mean EX an.pdf
Suppose X1Xn are iid random variables with mean EX an.pdfSuppose X1Xn are iid random variables with mean EX an.pdf
Suppose X1Xn are iid random variables with mean EX an.pdf
 
Suppose there is a minieconomy with two people A and B A s.pdf
Suppose there is a minieconomy with two people A and B A s.pdfSuppose there is a minieconomy with two people A and B A s.pdf
Suppose there is a minieconomy with two people A and B A s.pdf
 
Suppose we have a correctly working user program fragment L.pdf
Suppose we have a correctly working user program fragment L.pdfSuppose we have a correctly working user program fragment L.pdf
Suppose we have a correctly working user program fragment L.pdf
 
Suppose we have a random sample of size n from a population .pdf
Suppose we have a random sample of size n from a population .pdfSuppose we have a random sample of size n from a population .pdf
Suppose we have a random sample of size n from a population .pdf
 
Suppose the following data describe a nations population I.pdf
Suppose the following data describe a nations population I.pdfSuppose the following data describe a nations population I.pdf
Suppose the following data describe a nations population I.pdf
 
Suppose the Queensland Government is considering establishin.pdf
Suppose the Queensland Government is considering establishin.pdfSuppose the Queensland Government is considering establishin.pdf
Suppose the Queensland Government is considering establishin.pdf
 
Suppose three fair dice are rolled What is the probability .pdf
Suppose three fair dice are rolled What is the probability .pdfSuppose three fair dice are rolled What is the probability .pdf
Suppose three fair dice are rolled What is the probability .pdf
 
Suppose the work on ObjectOriented Design starts with the .pdf
Suppose the work on ObjectOriented Design starts with the .pdfSuppose the work on ObjectOriented Design starts with the .pdf
Suppose the work on ObjectOriented Design starts with the .pdf
 
suppose the prevalance P088 of type two diabetes follows .pdf
suppose the prevalance P088 of type two diabetes follows .pdfsuppose the prevalance P088 of type two diabetes follows .pdf
suppose the prevalance P088 of type two diabetes follows .pdf
 

Recently uploaded

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Adapter Pattern for Database and Web API Interface

  • 1. Suppose you have an existing application that uses a database to store and retrieve data. The application is built using an interface called IDatabase, which has methods: connect, executeQuery, and disconnect. Example usage: Now, you want to add a new feature to the application that requires data to be fetched from a web API. However, the web API has a different interface that you cannot change. It has methods: openConnection, sendRequest, and closeConnection. Use Adapter Pattern to adapts the web API to the IDatabase interface to fit the existing code without modifying it. Instructions: Choose either C++ or Java You do not need to implement the real logic in the method body. It's ok to use pseudo code. For example: public void openConnection() { some logic to open the connection} The focus is not to have a running program but show each required piece of Adapter Pattern and how they are connected. You can use a text editor instead of IDE to write the code. All classes can be put in one file.