Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Please define wrapper class

Posted on 2006-11-30
4
1,057 Views
Last Modified: 2008-02-01
I hear the term "wrapper class" used all the time but have never seen an actual defintion of it.

What does it mean? Is there a formal definition?

I guessed it could mean  a class that contains or inherits another class and perhaps exposes some of the included or inherited class methods and properties.

0
Comment
Question by:Christopher Schene
4 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 18046601
That's pretty much it...

I've also seen in other languages where a control must be housed by something else to make it work, and then you need to "echo" all the inherent events to outside subscribers using custom events.

Sometimes a "wrapper class" is used to make things easier:
http://en.wikipedia.org/wiki/Fa%C3%A7ade_pattern

In Java, the primitives are wrapped to allow them to be treated as objects:
http://en.wikipedia.org/wiki/Wrapper_class
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 18046613
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 18049190
I see it most often used for commonly used API calls.

Suppose you really like the Win API Bit Block Transfer (BitBlT) that everyone used back in the VB6 days.

Calling DllImport and marshalByRef and al lthat other crap gets to be a pain to do a simple BitBlt over and over.

So you create a class that does all of the Marshaling and dllimport and then you simple call the .net class
0
 
LVL 7

Expert Comment

by:mjmarlow
ID: 18051159
Not for the points, as the others have covered this well enough but here is my two cents

Wrapper class is a class that simplifies functionality by providing any of or combination of the following:
1.   Expose methods with fewer input parameters than would otherwise be needed.
2.   Aggregates method calls into a single method call.
3.   Redefines method, or property names for the sake of clarity or obscurity.
4.   Aggregates two or more classes to create a multiple inheritance effect.


0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Google Directions API to Map URL -C#? 3 37
Hey!!!! 1 24
How to parse the string and split the sub directory names in asp.net 7 54
MailAddress in vb 4 29
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question