Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "wrapping" mean in programming?

In programming literature and on internet in general I noticed frequent use of term "wrapping".

For example "to wrap library in classes" or to "wrap database". Is that official in programming or just a slang ? And what is the best way to describe it ?

Thanks

like image 361
Miroslav Trninic Avatar asked Mar 16 '12 21:03

Miroslav Trninic


People also ask

What is a wrapper in programming example?

A Wrapper is some code that is created to internally call some API without changing the actual API. An Example of this is Facebook's release of their Facebook C# SDK. The SDK is actually a wrapper since it only lets you call its underlying platform without giving you specific methods and classes.

What is mean by wrapping?

to cover or surround something with paper, cloth, or other material: She wrapped the present and tied it with ribbon.

What does wrapping data mean?

Simply put, data wrapping involves taking information that you already have, such as customer data, and using it to deliver more value by “wrapping” it around your current products and services.

What does wrapping mean in Java?

A Wrapper class is a class whose object wraps or contains primitive data types. When we create an object to a wrapper class, it contains a field and in this field, we can store primitive data types. In other words, we can wrap a primitive value into a wrapper class object.


1 Answers

"Wrap" is a standard English word meaning "Cover or enclose". Typically programmers use it to mean enclosing the functionality of something with something else. It's a fairly widely accepted term. There is no "official programming terms" guideline, so that's about as close as it gets.

Example:

  • a wrapper function is a function that calls another function;
  • a wrapping class is a class that holds inside itself a reference to another object;
  • the Facade design-pattern is a class/object that wraps around another object, for the purpose of simplifying the interface to access/use such object;
  • a Decorator design-pattern is a class/object that wraps around another object at run-time, for the purpose of enhancing the object's interface with new functionality (without having to modify the object itself).
like image 127
Amber Avatar answered Oct 02 '22 19:10

Amber