B
B
bx-coder2017-03-09 16:30:55
OOP
bx-coder, 2017-03-09 16:30:55

How to unify the call of the same type in meaning, but different in implementation methods?

For example, you need to write an aggregator of services for sending SMS messages from a website. Each service has its own api, which implements a certain method a la send (actually send a message). But the name of this method and its signature can change from service to service. And you need to make sure that in those places of the code where business logic (BL) is described using sending messages, a single send method (of type SmsSender::send()) is used. How to correctly implement this, which pattern suits the most?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-03-09
@qonand

If you understand the problem correctly, then the adapter will suit you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question