What is a Wrapper

Discussion in 'C++' started by utab, Oct 1, 2006.

  1. utab

    utab Guest

    Dear all,

    In programming terminology, what is a wrapper and where is it used?

    Regards
     
    utab, Oct 1, 2006
    #1
    1. Advertising

  2. utab

    Moonlit Guest

    Hi

    -


    "utab" <> wrote in message
    news:...
    > Dear all,
    >
    > In programming terminology, what is a wrapper and where is it used?

    Well for instance you could use a C++ wrapper class around regular C code.

    For instance in my personal generic library I have a wrapper class around
    the pnglib libary I can the open an ifstream of a .png file and read it with
    operator>> or write png files with operator<<. This also works for memory
    streams etc. The C++ wrapper takes care of memory allocation and freeing the
    memory and of the complexity of setting the pointers to static members to
    replace the standard C FILE oriented operations.

    i.e. the complexity is inside the C++ wrapper class. The wrapper class
    itself is extremely simple to use. Instead of looking in the manual of png
    everytime I can now load and save png in a very simple way.
    >
    > Regards
    >


    Regards, Ron AF Greve

    http://moonlit.xs4all.nl
     
    Moonlit, Oct 1, 2006
    #2
    1. Advertising

  3. utab

    utab Guest

    Moonlit wrote:
    > Hi
    >
    > -
    >
    >
    > "utab" <> wrote in message
    > news:...
    > > Dear all,
    > >
    > > In programming terminology, what is a wrapper and where is it used?

    > Well for instance you could use a C++ wrapper class around regular C code.
    >
    > For instance in my personal generic library I have a wrapper class around
    > the pnglib libary I can the open an ifstream of a .png file and read it with
    > operator>> or write png files with operator<<. This also works for memory
    > streams etc. The C++ wrapper takes care of memory allocation and freeing the
    > memory and of the complexity of setting the pointers to static members to
    > replace the standard C FILE oriented operations.
    >
    > i.e. the complexity is inside the C++ wrapper class. The wrapper class
    > itself is extremely simple to use. Instead of looking in the manual of png
    > everytime I can now load and save png in a very simple way.
    > >
    > > Regards
    > >

    >
    > Regards, Ron AF Greve
    >
    > http://moonlit.xs4all.nl


    Thanks Ron,

    So in a simple manner, it is a code block to make things easier for
    mixed-language programming(for the original C library in your case.).
    Then briefly speaking, this is related to using more than one language
    in your code. Am I correct?

    Regards,
     
    utab, Oct 1, 2006
    #3
  4. utab

    Moonlit Guest

    "utab" <> wrote in message
    news:...
    >
    > Moonlit wrote:
    >> Hi
    >>
    >> -
    >>
    >>
    >> "utab" <> wrote in message
    >> news:...
    >> > Dear all,
    >> >
    >> > In programming terminology, what is a wrapper and where is it used?

    >> Well for instance you could use a C++ wrapper class around regular C
    >> code.
    >>
    >> For instance in my personal generic library I have a wrapper class around
    >> the pnglib libary I can the open an ifstream of a .png file and read it
    >> with
    >> operator>> or write png files with operator<<. This also works for memory
    >> streams etc. The C++ wrapper takes care of memory allocation and freeing
    >> the
    >> memory and of the complexity of setting the pointers to static members to
    >> replace the standard C FILE oriented operations.
    >>
    >> i.e. the complexity is inside the C++ wrapper class. The wrapper class
    >> itself is extremely simple to use. Instead of looking in the manual of
    >> png
    >> everytime I can now load and save png in a very simple way.
    >> >
    >> > Regards
    >> >

    >>
    >> Regards, Ron AF Greve
    >>
    >> http://moonlit.xs4all.nl

    >
    > Thanks Ron,
    >
    > So in a simple manner, it is a code block to make things easier for
    > mixed-language programming(for the original C library in your case.).
    > Then briefly speaking, this is related to using more than one language
    > in your code. Am I correct?


    I think it is indeed mostly ( if not always ) used to make things easier.

    The second statement is a bit more difficult to answer since C is for the
    most part also C++. But all of my wrapper classes are indeed around regular
    C functions/ libraries and not around C++ libraries. But I could imagine
    that when you have a complex C++ library and you only want to use part of it
    you might still want to write a wrapper class around it (then again maybe
    the library itself should have been redesigned) . But from a practical point
    of view I think that is right.
    >
    > Regards,
    >


    --


    Regards, Ron AF Greve

    http://moonlit.xs4all.nl
     
    Moonlit, Oct 1, 2006
    #4
  5. utab posted:

    > In programming terminology, what is a wrapper and where is it used?



    I'm not sure if this is a generally accepted meaning of the term, but I
    take "wrapper" to mean anything which erects a 20-foot-tall wall around
    something and provides a nice simple interface to the outside world. For
    instance, we might create a wrapper for working with individual bits in
    memory:

    #include <climits>

    class BitHandle {
    private:

    char unsigned *p;
    unsigned index;

    public:

    operator bool() const
    {
    return *p & 1U<<index;
    }

    BitHandle &operator=(bool const val)
    {
    if(val) *p |= 1U<<index;
    else *p &= ~(1U<<index);

    return *this;
    }

    BitHandle &operator++() const
    {
    if(CHAR_BIT == index) ++p, index = 0;
    else ++index;

    return *this;
    }
    };

    --

    Frederick Gotham
     
    Frederick Gotham, Oct 1, 2006
    #5
  6. Frederick Gotham posted:

    > BitHandle &operator++() const



    Of course, that shouldn't be const (but then again it wasn't a full example
    to start off with).

    --

    Frederick Gotham
     
    Frederick Gotham, Oct 1, 2006
    #6
  7. utab

    utab Guest

    Moonlit wrote:
    > "utab" <> wrote in message
    > news:...
    > >
    > > Moonlit wrote:
    > >> Hi
    > >>
    > >> -
    > >>
    > >>
    > >> "utab" <> wrote in message
    > >> news:...
    > >> > Dear all,
    > >> >
    > >> > In programming terminology, what is a wrapper and where is it used?
    > >> Well for instance you could use a C++ wrapper class around regular C
    > >> code.
    > >>
    > >> For instance in my personal generic library I have a wrapper class around
    > >> the pnglib libary I can the open an ifstream of a .png file and read it
    > >> with
    > >> operator>> or write png files with operator<<. This also works for memory
    > >> streams etc. The C++ wrapper takes care of memory allocation and freeing
    > >> the
    > >> memory and of the complexity of setting the pointers to static members to
    > >> replace the standard C FILE oriented operations.
    > >>
    > >> i.e. the complexity is inside the C++ wrapper class. The wrapper class
    > >> itself is extremely simple to use. Instead of looking in the manual of
    > >> png
    > >> everytime I can now load and save png in a very simple way.
    > >> >
    > >> > Regards
    > >> >
    > >>
    > >> Regards, Ron AF Greve
    > >>
    > >> http://moonlit.xs4all.nl

    > >
    > > Thanks Ron,
    > >
    > > So in a simple manner, it is a code block to make things easier for
    > > mixed-language programming(for the original C library in your case.).
    > > Then briefly speaking, this is related to using more than one language
    > > in your code. Am I correct?

    >
    > I think it is indeed mostly ( if not always ) used to make things easier.
    >
    > The second statement is a bit more difficult to answer since C is for the
    > most part also C++. But all of my wrapper classes are indeed around regular
    > C functions/ libraries and not around C++ libraries. But I could imagine
    > that when you have a complex C++ library and you only want to use part of it
    > you might still want to write a wrapper class around it (then again maybe
    > the library itself should have been redesigned) . But from a practical point
    > of view I think that is right.
    > >
    > > Regards,
    > >

    >
    > --
    >
    >
    > Regards, Ron AF Greve
    >
    > http://moonlit.xs4all.nl


    Thanks again,

    What do you mean by this

    "But I could imagine
    that when you have a complex C++ library and you only want to use part
    of it
    you might still want to write a wrapper class around it "

    You mean to copy the parts you like to use for a complete C
    application(in a class).

    Is that also related with compatibility while using two languages. I
    mean type compatibility, for instance C does not have a built-in vector
    type but C++ has. And while writing some code which needs to use
    vectors in the code for instance, you use a proper C++ wrapper in the
    proper interface to use these features of C++ in C. Am I completely
    confusing or on the right way?

    Regards,
    Regards,
     
    utab, Oct 1, 2006
    #7
  8. utab

    utab Guest

    Frederick Gotham wrote:
    > utab posted:
    >
    > > In programming terminology, what is a wrapper and where is it used?

    >
    >
    > I'm not sure if this is a generally accepted meaning of the term, but I
    > take "wrapper" to mean anything which erects a 20-foot-tall wall around
    > something and provides a nice simple interface to the outside world. For
    > instance, we might create a wrapper for working with individual bits in
    > memory:
    >
    > #include <climits>
    >
    > class BitHandle {
    > private:
    >
    > char unsigned *p;
    > unsigned index;
    >
    > public:
    >
    > operator bool() const
    > {
    > return *p & 1U<<index;
    > }
    >
    > BitHandle &operator=(bool const val)
    > {
    > if(val) *p |= 1U<<index;
    > else *p &= ~(1U<<index);
    >
    > return *this;
    > }
    >
    > BitHandle &operator++() const
    > {
    > if(CHAR_BIT == index) ++p, index = 0;
    > else ++index;
    >
    > return *this;
    > }
    > };
    >
    > --
    >
    > Frederick Gotham


    Dear Frederick,

    So that is a way to make things more understantable from the
    programmers point of view. Using the existing but in a fancier
    interface(in a different form).

    Regards
     
    utab, Oct 1, 2006
    #8
  9. utab

    Arve Sollie Guest

    > Is that also related with compatibility while using two languages. I
    > mean type compatibility, for instance C does not have a built-in vector
    > type but C++ has. And while writing some code which needs to use


    Does C++ implement a Vector type ?
    STL maybe, but not C++ as an intrinsic type, as far as I know.



    "utab" <> wrote in message
    news:...
    >
    > Moonlit wrote:
    >> "utab" <> wrote in message
    >> news:...
    >> >
    >> > Moonlit wrote:
    >> >> Hi
    >> >>
    >> >> -
    >> >>
    >> >>
    >> >> "utab" <> wrote in message
    >> >> news:...
    >> >> > Dear all,
    >> >> >
    >> >> > In programming terminology, what is a wrapper and where is it used?
    >> >> Well for instance you could use a C++ wrapper class around regular C
    >> >> code.
    >> >>
    >> >> For instance in my personal generic library I have a wrapper class
    >> >> around
    >> >> the pnglib libary I can the open an ifstream of a .png file and read
    >> >> it
    >> >> with
    >> >> operator>> or write png files with operator<<. This also works for
    >> >> memory
    >> >> streams etc. The C++ wrapper takes care of memory allocation and
    >> >> freeing
    >> >> the
    >> >> memory and of the complexity of setting the pointers to static members
    >> >> to
    >> >> replace the standard C FILE oriented operations.
    >> >>
    >> >> i.e. the complexity is inside the C++ wrapper class. The wrapper class
    >> >> itself is extremely simple to use. Instead of looking in the manual of
    >> >> png
    >> >> everytime I can now load and save png in a very simple way.
    >> >> >
    >> >> > Regards
    >> >> >
    >> >>
    >> >> Regards, Ron AF Greve
    >> >>
    >> >> http://moonlit.xs4all.nl
    >> >
    >> > Thanks Ron,
    >> >
    >> > So in a simple manner, it is a code block to make things easier for
    >> > mixed-language programming(for the original C library in your case.).
    >> > Then briefly speaking, this is related to using more than one language
    >> > in your code. Am I correct?

    >>
    >> I think it is indeed mostly ( if not always ) used to make things easier.
    >>
    >> The second statement is a bit more difficult to answer since C is for the
    >> most part also C++. But all of my wrapper classes are indeed around
    >> regular
    >> C functions/ libraries and not around C++ libraries. But I could imagine
    >> that when you have a complex C++ library and you only want to use part of
    >> it
    >> you might still want to write a wrapper class around it (then again maybe
    >> the library itself should have been redesigned) . But from a practical
    >> point
    >> of view I think that is right.
    >> >
    >> > Regards,
    >> >

    >>
    >> --
    >>
    >>
    >> Regards, Ron AF Greve
    >>
    >> http://moonlit.xs4all.nl

    >
    > Thanks again,
    >
    > What do you mean by this
    >
    > "But I could imagine
    > that when you have a complex C++ library and you only want to use part
    > of it
    > you might still want to write a wrapper class around it "
    >
    > You mean to copy the parts you like to use for a complete C
    > application(in a class).
    >
    > Is that also related with compatibility while using two languages. I
    > mean type compatibility, for instance C does not have a built-in vector
    > type but C++ has. And while writing some code which needs to use
    > vectors in the code for instance, you use a proper C++ wrapper in the
    > proper interface to use these features of C++ in C. Am I completely
    > confusing or on the right way?
    >
    > Regards,
    > Regards,
    >
     
    Arve Sollie, Oct 1, 2006
    #9
  10. utab

    utab Guest

    Arve Sollie wrote:
    > > Is that also related with compatibility while using two languages. I
    > > mean type compatibility, for instance C does not have a built-in vector
    > > type but C++ has. And while writing some code which needs to use

    >
    > Does C++ implement a Vector type ?
    > STL maybe, but not C++ as an intrinsic type, as far as I know.
    >
    >
    >
    > "utab" <> wrote in message
    > news:...
    > >
    > > Moonlit wrote:
    > >> "utab" <> wrote in message
    > >> news:...
    > >> >
    > >> > Moonlit wrote:
    > >> >> Hi
    > >> >>
    > >> >> -
    > >> >>
    > >> >>
    > >> >> "utab" <> wrote in message
    > >> >> news:...
    > >> >> > Dear all,
    > >> >> >
    > >> >> > In programming terminology, what is a wrapper and where is it used?
    > >> >> Well for instance you could use a C++ wrapper class around regular C
    > >> >> code.
    > >> >>
    > >> >> For instance in my personal generic library I have a wrapper class
    > >> >> around
    > >> >> the pnglib libary I can the open an ifstream of a .png file and read
    > >> >> it
    > >> >> with
    > >> >> operator>> or write png files with operator<<. This also works for
    > >> >> memory
    > >> >> streams etc. The C++ wrapper takes care of memory allocation and
    > >> >> freeing
    > >> >> the
    > >> >> memory and of the complexity of setting the pointers to static members
    > >> >> to
    > >> >> replace the standard C FILE oriented operations.
    > >> >>
    > >> >> i.e. the complexity is inside the C++ wrapper class. The wrapper class
    > >> >> itself is extremely simple to use. Instead of looking in the manual of
    > >> >> png
    > >> >> everytime I can now load and save png in a very simple way.
    > >> >> >
    > >> >> > Regards
    > >> >> >
    > >> >>
    > >> >> Regards, Ron AF Greve
    > >> >>
    > >> >> http://moonlit.xs4all.nl
    > >> >
    > >> > Thanks Ron,
    > >> >
    > >> > So in a simple manner, it is a code block to make things easier for
    > >> > mixed-language programming(for the original C library in your case.).
    > >> > Then briefly speaking, this is related to using more than one language
    > >> > in your code. Am I correct?
    > >>
    > >> I think it is indeed mostly ( if not always ) used to make things easier.
    > >>
    > >> The second statement is a bit more difficult to answer since C is for the
    > >> most part also C++. But all of my wrapper classes are indeed around
    > >> regular
    > >> C functions/ libraries and not around C++ libraries. But I could imagine
    > >> that when you have a complex C++ library and you only want to use part of
    > >> it
    > >> you might still want to write a wrapper class around it (then again maybe
    > >> the library itself should have been redesigned) . But from a practical
    > >> point
    > >> of view I think that is right.
    > >> >
    > >> > Regards,
    > >> >
    > >>
    > >> --
    > >>
    > >>
    > >> Regards, Ron AF Greve
    > >>
    > >> http://moonlit.xs4all.nl

    > >
    > > Thanks again,
    > >
    > > What do you mean by this
    > >
    > > "But I could imagine
    > > that when you have a complex C++ library and you only want to use part
    > > of it
    > > you might still want to write a wrapper class around it "
    > >
    > > You mean to copy the parts you like to use for a complete C
    > > application(in a class).
    > >
    > > Is that also related with compatibility while using two languages. I
    > > mean type compatibility, for instance C does not have a built-in vector
    > > type but C++ has. And while writing some code which needs to use
    > > vectors in the code for instance, you use a proper C++ wrapper in the
    > > proper interface to use these features of C++ in C. Am I completely
    > > confusing or on the right way?
    > >
    > > Regards,
    > > Regards,
    > >


    Of course STL, thanks for the warning
     
    utab, Oct 1, 2006
    #10
  11. utab posted:

    > Dear Frederick,
    >
    > So that is a way to make things more understantable from the
    > programmers point of view. Using the existing but in a fancier
    > interface(in a different form).



    The idea is "encapsulation", i.e. the separation of one complicated idea
    from another.

    Let's take "std::string" for example. People always cheer about how much
    more simple it is to work with than null-terminated arrays of char.

    But the reality is this: Nothing has been simplified -- the code for
    "std::string" contains the same nitty-gritty pointers and manipulation of
    null-terminated char arrays.

    The only thing that's changed is that a partition has been put up between
    "this stuff" and "that stuff", giving the idea that things have been
    simplified.

    It's like having two petry dishes side by side, each containing a little
    blob of liquid. If we zoom out, we don't seen anything that complicated,
    just two blobs of liquid side by side... but if we zoom in on one of them,
    we'll see all the complexity of the molecular bonds and so forth...

    The idea behind encapsulation is to zoom out and look at the big picture --
    it makes everything look nice and simple in our minds.

    Wrappers make encapsulation possible. You could say that "std::string" is a
    wrapper for simplifing the complexity of working with strings.

    --

    Frederick Gotham
     
    Frederick Gotham, Oct 1, 2006
    #11
  12. utab

    Greg Comeau Guest

    In article <>,
    utab <> wrote:
    >So that is a way to make things more understantable from the
    >programmers point of view. Using the existing but in a fancier
    >interface(in a different form).


    Kind of. What wrappers often intend to provide is some way to
    modify a set of existing interfaces to be more in line with the
    criterea and view and design of something else. Obviously then
    it is not always successful, or easy. Sometimes it is a way to
    establish a bridge to a library or between 2 libraries. An
    adapter if you will.

    Also, wrappers can often be used to constrain or change or even
    check the expectations of the thing be wrapped. For instance,
    a thread here yesterday showed somebody wrapped std::vector to
    detect a possible out of range situation.
    --
    Greg Comeau / 20 years of Comeauity! Intel Mac Port now in alpha!
    Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
    World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
    Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
     
    Greg Comeau, Oct 1, 2006
    #12
  13. utab

    Greg Comeau Guest

    In article <>,
    Arve Sollie <> wrote:
    >> Is that also related with compatibility while using two languages. I
    >> mean type compatibility, for instance C does not have a built-in vector
    >> type but C++ has. And while writing some code which needs to use

    >
    >Does C++ implement a Vector type ?


    Builtin arrays.

    >STL maybe, but not C++ as an intrinsic type, as far as I know.


    Otherwise yeah, stuff like std::vector, std::string etc
    which are library.
    --
    Greg Comeau / 20 years of Comeauity! Intel Mac Port now in alpha!
    Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
    World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
    Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
     
    Greg Comeau, Oct 1, 2006
    #13
  14. utab

    Moonlit Guest

    "utab" <> wrote in message
    news:...
    >
    > Moonlit wrote:
    >> "utab" <> wrote in message
    >> news:...
    >> >
    >> > Moonlit wrote:
    >> >> Hi
    >> >>
    >> >> -
    >> >>
    >> >>
    >> >> "utab" <> wrote in message
    >> >> news:...
    >> >> > Dear all,
    >> >> >
    >> >> > In programming terminology, what is a wrapper and where is it used?
    >> >> Well for instance you could use a C++ wrapper class around regular C
    >> >> code.
    >> >>
    >> >> For instance in my personal generic library I have a wrapper class
    >> >> around
    >> >> the pnglib libary I can the open an ifstream of a .png file and read
    >> >> it
    >> >> with
    >> >> operator>> or write png files with operator<<. This also works for
    >> >> memory
    >> >> streams etc. The C++ wrapper takes care of memory allocation and
    >> >> freeing
    >> >> the
    >> >> memory and of the complexity of setting the pointers to static members
    >> >> to
    >> >> replace the standard C FILE oriented operations.
    >> >>
    >> >> i.e. the complexity is inside the C++ wrapper class. The wrapper class
    >> >> itself is extremely simple to use. Instead of looking in the manual of
    >> >> png
    >> >> everytime I can now load and save png in a very simple way.
    >> >> >
    >> >> > Regards
    >> >> >
    >> >>
    >> >> Regards, Ron AF Greve
    >> >>
    >> >> http://moonlit.xs4all.nl
    >> >
    >> > Thanks Ron,
    >> >
    >> > So in a simple manner, it is a code block to make things easier for
    >> > mixed-language programming(for the original C library in your case.).
    >> > Then briefly speaking, this is related to using more than one language
    >> > in your code. Am I correct?

    >>
    >> I think it is indeed mostly ( if not always ) used to make things easier.
    >>
    >> The second statement is a bit more difficult to answer since C is for the
    >> most part also C++. But all of my wrapper classes are indeed around
    >> regular
    >> C functions/ libraries and not around C++ libraries. But I could imagine
    >> that when you have a complex C++ library and you only want to use part of
    >> it
    >> you might still want to write a wrapper class around it (then again maybe
    >> the library itself should have been redesigned) . But from a practical
    >> point
    >> of view I think that is right.
    >> >
    >> > Regards,
    >> >

    >>
    >> --
    >>
    >>
    >> Regards, Ron AF Greve
    >>
    >> http://moonlit.xs4all.nl

    >
    > Thanks again,
    >
    > What do you mean by this
    >
    > "But I could imagine
    > that when you have a complex C++ library and you only want to use part
    > of it
    > you might still want to write a wrapper class around it "
    >
    > You mean to copy the parts you like to use for a complete C
    > application(in a class).
    >
    > Is that also related with compatibility while using two languages. I
    > mean type compatibility, for instance C does not have a built-in vector
    > type but C++ has. And while writing some code which needs to use
    > vectors in the code for instance, you use a proper C++ wrapper in the
    > proper interface to use these features of C++ in C. Am I completely
    > confusing or on the right way?


    Hm, that's a bit hard for me to answer since I never have come across code
    that uses C++ functions from C.

    As mentioned in other parts of this thread I think it is mostly used for
    encapsulation. Making something easier to use. You put the effort in once to
    make the class correct and handle all the dificulties of the encapsulated
    thing (be it a library, a bunch of functions or maybe even other C++
    classes). And for then on you only have to use the simple interface of your
    C++ class.

    But I don't think there is really a 'tight' definition of a wrapper class
    (at least not that I know of). So as long as you wrap things inside it, it
    probably is a moot point whether it is a wrapper or not. But I think the way
    most people feel about it is in the previous paragraph, i.e. encapsulation,
    hiding the complexity of something inside the wrapper class..
    >
    > Regards,
    > Regards,
    >


    --


    Regards, Ron AF Greve

    http://moonlit.xs4all.nl
     
    Moonlit, Oct 1, 2006
    #14
  15. utab schrieb:
    > In programming terminology, what is a wrapper and where is it used?


    I think it is the same as the Adapter design pattern:
    http://en.wikipedia.org/wiki/Wrapper
    http://en.wikipedia.org/wiki/Adapter_pattern

    A wrapper/adapter presents an interface using some code with has another
    interface.

    The reason could be everything from interlanguage programming (calling C++
    from C or vice versa) to wrapping an ostream into a C++ interator
    (ostream_iterator<> template). The links give other examples too.

    --
    Thomas
    http://www.netmeister.org/news/learn2quote.html
     
    Thomas J. Gritzan, Oct 1, 2006
    #15
  16. On Sun, 01 Oct 2006 17:46:55 +0200, "Thomas J. Gritzan" wrote:
    >utab schrieb:
    >> In programming terminology, what is a wrapper and where is it used?

    >
    >A wrapper/adapter presents an interface using some code with has another
    >interface.


    IMO, there is a subtle difference between adapter and wrapper in C++.
    Adapted code is somehow 'visible' to the user (think of container
    adapters) whereas wrappers entirely hide the wrapped code. Adapters
    are workarounds (like a USB to PS/2 keyboard adaper).

    Best wishes,
    Roland Pibinger
     
    Roland Pibinger, Oct 1, 2006
    #16
  17. utab

    Steve Pope Guest

    Greg Comeau <> wrote:

    >utab <> wrote:


    >>So that is a way to make things more understantable from the
    >>programmers point of view. Using the existing but in a fancier
    >>interface(in a different form).


    >Kind of. What wrappers often intend to provide is some way to
    >modify a set of existing interfaces to be more in line with the
    >criterea and view and design of something else. Obviously then
    >it is not always successful, or easy. Sometimes it is a way to
    >establish a bridge to a library or between 2 libraries. An
    >adapter if you will.


    >Also, wrappers can often be used to constrain or change or even
    >check the expectations of the thing be wrapped.


    Yes, I agree with this -- a wrapper doesn't necessarily form
    a simpler interface than the one below it, nor does it necessarily
    interface one underlying programming language to another. It
    does change the interface (while doing little or no actual
    processing) to meet some set of different expectation.

    Steve
     
    Steve Pope, Oct 3, 2006
    #17
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Duffy
    Replies:
    0
    Views:
    4,778
    Brendan Duffy
    Jul 25, 2003
  2. Nilsson Mats

    Wrapper on magic line?

    Nilsson Mats, Dec 9, 2003, in forum: Perl
    Replies:
    0
    Views:
    649
    Nilsson Mats
    Dec 9, 2003
  3. Showjumper
    Replies:
    2
    Views:
    482
    Showjumper
    Jul 4, 2003
  4. Brian Pittman

    wrapper function for uploading files

    Brian Pittman, Jul 30, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    507
    Kevin Spencer
    Jul 30, 2003
  5. Marlene Arauz

    Deployment of DTSPKG.DLL wrapper

    Marlene Arauz, Nov 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    573
    Marlene Arauz
    Nov 10, 2003
Loading...

Share This Page