Does it make sense to use an api to access another api? (bematec one in this case)

Asked

Viewed 122 times

2

I was asked to make an API here where I work to integrate some systems with nfce. For that, they hired the one api. More information can be found here: http://bematechpartners.com.br/portalPartners/index.php/api-one-central-download/.

The real question is how and why should I make an API to access another API? It would not be easier for old programs to directly access this bematec one api?

Has programs made in Vb, others in c# and a php.

EDIT: I’ll try to apply one of these forms here. Thank you to the respondent! https://sensedia.com/blog/apis/estrategias-sem-impacto-no-backend-para-expor-apis/

2 answers

1


Yes.

Creating an abstraction interface for legacy systems to access new services is something common, if not more recommendable, when:

  • The cost of changing legacy systems is very significant
  • The consuming API may change frequently, or is unstable and could break your applications in some way
  • You want to implement extra functionality that would not be possible in legacy systems
    • Level of access control
    • Metrics
    • Request caching (both to search for data, and to send data)

These are some of the reasons. Legacy systems in general aggravate the need for these interfaces (which as @Afonso said, serve as Design pattern Façade).

There are reasons not to do this, the most obvious being to be less laborious to immediately implement the calls in their old programs:

  • Have points contrary to those I mentioned above
  • Legacy systems no longer accessed any standard interface before, even programming to access your internal enterprise API would require work

This answer is more complex and this was a summary. But when in doubt, do what would seem to be less work. But if someone who worked with an old system at your company says it would be less trouble to do something new (which, look, from what they said they would have said is an option to choose), it’s a good indication of what you don’t know about the technical difficulties

  • Thank you, I don’t really know the technical difficulties, because I never touched the code of these old systems (and I don’t even have permission), I’m kind of new in the company.

0

It seems to me that it might be worthwhile to integrate all systems centrally. It is worth seeing the drawing pattern Fascade - https://www.tutorialspoint.com/design_pattern/facade_pattern.htm

Facade Pattern Hides the complexities of the system and provides an interface to the client using which the client can access the system. This type of design Pattern comes under structural Pattern as this Pattern adds an interface to existing system to Hide its complexities.

This Pattern involves a single class which provides simplified methods required by client and delegates calls to methods of existing system classes.

  • in case I forgot to mention that the api n will have access to bank, seems to me something abnormal. seems interesting the use of the facade, I will take a look

Browser other questions tagged

You are not signed in. Login or sign up in order to post.