Jump to content

Wrapper function

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 71.94.154.159 (talk) at 22:47, 18 October 2017 (Adapting class/object interfaces). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A wrapper function is a subroutine in a software library or a computer program whose main purpose is to call a second subroutine[1] or a system call with little or no additional computation.

Purpose

Wrapper functions are a means of delegation and can be used for a number of purposes.

Programming convenience

Wrapper functions can be used to make writing computer programs easier. An example of this is the MouseAdapter and similar classes in the Java AWT library.[2] Wrapper functions are useful in the development of applications that use third-party library functions. A wrapper can be written for each of the third party functions and used in the native application. In case the third party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application. wqoqwjndw

Content that violates any copyrights will be deleted. Encyclopedic content must be verifiable. Work submitted to Wikipedia can be edited, used, and redistributed—by anyone—subject to certain terms and conditions.\.. Sign in Google


apple


AllNewsMapsImagesShoppingMore SettingsTools About 2,120,000,000 results (0.97 seconds) Search Results Apple https://www.apple.com/ Announcements included the new iPhone X and iPhone 8, Apple Watch with cellular connectivity, Apple TV 4K, and much more.

Search apple.com

iPhone Explore iPhone, the world's most powerful personal device ... Mac MacBook Air - iMac Pro - iMac - Compare - ... Apple Support Apple support is here to help. Learn more about popular ... Watch - Apple Apple Watch is the ultimate device for a healthy life. Choose from ... iPad Check out iPad Pro, available in two sizes, iPad, and iPad mini ... Glendale Galleria Apple Store Glendale Galleria store hours, contact information ... Top stories

Economist lays out a ‘concerning’ trend for Apple stock CNBC.com · 11 hours ago

Apple and GE announce deep partnership TechCrunch · 10 hours ago

Apple Co-Founder Launches Technology School VOA Learning English · 45 mins ago More for apple Map of applemap expand icon Hours A Apple Glendale Galleria Glendale Galleria Glendale, CA · (818) 502-8310 Open until 9:00 PM WEBSITE DIRECTIONS B Apple The Americana at Brand The Americana at Brand Glendale, CA · (818) 254-1070 Open until 9:00 PM WEBSITE DIRECTIONS C Apple Pasadena Pasadena, CA · (626) 463-6223 Open until 9:00 PM WEBSITE DIRECTIONS More locations Apple in Glendale, CA | Glendale Galleria https://www.glendalegalleria.com/en/directory/apple-2608.html The Apple Store is the best place to try all of Apple's products and find great accessories. Our Specialists will answer your questions and get you set up before ... Apple Inc. - Wikipedia https://en.wikipedia.org/wiki/Apple_Inc. Apple Inc. is an American multinational technology company headquartered in Cupertino, California that designs, develops, and sells consumer electronics, ... Apple - YouTube https://www.youtube.com/user/Apple Apple revolutionized personal technology with the introduction of the Macintosh in 1984. Today, Apple leads the world in innovation with iPhone, iPad, Mac, A... Apple (@Apple) | Twitter https://twitter.com/apple?lang=en Apple News @applenws · Cult of Mac @cultofmac · iTunes MoviesVerified ... @Apple hasn't Tweeted. When they do, their Tweets will show up here. Close ... Apple - Home | Facebook https://www.facebook.com/apple/ Highlights info row image. Contact Apple on Messenger. Highlights info row image. Product/Service. People. 8,543,618 likes. 3,350,304 visits. People Also Like. Searches related to apple apple products apple sign in apple store near me apple store online apple phone number apple store appointment apple wiki apple fruit 1 2 3 4 5 6 7 8 9 10 Next Apple Technology company Image result for apple apple.com Apple Inc. is an American multinational technology company headquartered in Cupertino, California that designs, develops, and sells consumer electronics, computer software, and online services. Wikipedia Stock price: AAPL (NASDAQ) $159.76 -0.71 (-0.44%) Oct 18, 4:00 PM EDT - Disclaimer Founded: April 1, 1976, Cupertino, CA Headquarters: Cupertino, CA Founders: Steve Jobs, Steve Wozniak, Ronald Wayne Subsidiaries: Beats Electronics, SensoMotoric Instruments, MORE Products: iPhone, iPad, iPod, iPhone 7, Macintosh, Apple Watch, MORE Did you know: Apple Inc. is the world's second-largest information technology company by revenue. wikipedia.org Profiles

YouTube

Twitter

Facebook

LinkedIn

Google+ People also search for View 15+ more

Google

Microsoft Corporation

Best Buy

Dell

Federal Bureau of Investigation Feedback Disclaimer Crescenta Highlands, Glendale, CA - From your Internet address - Use precise location - Learn more Help Send feedback Privacy Terms[3] Content that violates any copyrights will be deleted. Encyclopedic content must be verifiable. Work submitted to Wikipedia can be edited, used, and redistributed—by anyone—subject to certain terms and conditions.§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly You are not logged in. Your IP address will be publicly

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or objectrd party functions change or are updated, only the wrappers in the native application need to be modified as opposed to changing all instances of third party functions in the native application.

Adapting class/object interfaces

Wrapper functions can be used to adapt an existing class or object to have a different interface. This is especially useful when using existing library code.

Code testing

Wrapper functions can be used to write error checking routines for pre-existing system functions without increasing the length of a code by a large amount by repeating the same error check for each call to the function.[4] All calls to the original function can be replaced with calls to the wrapper, allowing the programmer to forget about error checking once the wrapper is written. A test driver is a kind of wrapper function that exercises a code module, typically calling it repeatedly, with different settings or parameters, in order to rigorously pursue each possible path. It is not deliverable code, but is not throwaway code either, being typically retained for use in regression testing. An interface adaptor is a kind of wrapper function that simplifies, tailors, or amplifies the interface to a code module, with the intent of making it more intelligible or relevant to the user. It may rename parameters, combine parameters, set defaults for parameters, and the like.

Multiple inheritance

In a programming language that does not support multiple inheritance of base classes, wrapper functions can be used to simulate it. Below is an example of part of a Java class that "inherits" from LinkedList and HashSet.

Library functions and system calls

Many library functions, such as those in the C Standard Library, act as interfaces for abstraction of system calls. The fork and execve functions in glibc are examples of this. They call the lower-level fork and execve system calls, respectively.

This may lead to incorrectly using the terms "system call" and "syscall" to refer to higher-level library calls rather than the similarly named system calls, which they wrap.[citation needed]

See also

References

  1. ^ Reselman, Bob; Peasley, Richard; Pruchniak, Wayne (1998). Using Visual Basic 6. Que. p. 446. ISBN 9780789716330.
  2. ^ The Java Tutorials
  3. ^ lol
  4. ^ Stevens, Richard; Fenner, Bill; Rudoff; Andrew M. (2003). UNIX Network Programming. Addison-Wesley. pp. 5–6, 29. ISBN 9780131411555.