Generally speaking, does a wrapper class make an API call slower?
-
I am sure the first answer to this question is "it depends", but what I am trying to find out is, if a web application is heavily dependent on API calls to sites like LinkedIn or Facebook, does it make a difference in response time/ server load if one uses a wrapper class to call the API as opposed to directily interacting with the API? In other words, is the use of wrapper class worth it?
-
Answer:
You're right that the answer is "it depends" on the wrapper itself. I'd say though that assuming the wrapper isn't poorly written the extra time passing through the wrapper code should be negligible v's the time taken to make the actual call out. An API call out can be 50-100ms for fast APIs, more in some cases. It's unlikely a wrapper will add anything close to that. If you skip the wrapper then you'll most likely still need code to call the API (which will have it's own execution time). The advantage of a wrapper is that you can better compartmentalize code and abstract the actual API calls to make it more maintainable. Further if the API wrapper is provided by the API provider then it may be easier to do updates in the in future than with your own custom code. In some cases the wrapper might even call the API in a smart way to cut down the number of calls. Mainly comes down to how good the wrapper code is. If you look at it and start itching to optimise it then you probably have your answer...!
Steven Willmott at Quora Visit the source
Related Q & A:
- Is it correct to extend a bean class and write a class which holds logic to populate the bean we extend?Best solution by stackoverflow.com
- Is there a way to make my speaking voice more appealing?Best solution by Yahoo! Answers
- Is it better to get a higher grade in a easier class or a mediocre/low grade in a hard class?Best solution by greatcollegeadvice.com
- Which is better, A in an easy class or B/C in a hard class?Best solution by monkeysee.com
- What's the cheapest way to make an international call to a cell phone?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.