Questions tagged [wrapper]

A wrapper is an OOP technique where an object encapsulates (wraps) another object, hiding/protecting the object and controlling all access to it.

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Write to the event log without needing to check whether or not it exists by use of a `-Force` parameter

Below is some powershell to write to the event log; if the -Force parameter is specified this saves you the effort of writing additional code to first check whether ...
3
votes
3answers
953 views

WinSCP IDisposable Wrapper

I have written a simple wrapper for WinSCP in C#. I have written it to simplify SFTP connections I will needing to perform. ...
7
votes
2answers
535 views

Scala BitSet implemented with Java BitSet, for use in Scala Enumerations to replace ValueSet

Due to a performance profiling hotspot detailed here, I implemented my own BitSet using Java's BitSet. This is intended to ...
2
votes
2answers
726 views

“Rational” Wrapper class with support for Rational Number Approximation

Enough with imprecise floating point datatypes called float anddouble. I present to you Rational. Of course, Rational number ...
2
votes
1answer
375 views

Point2D.Double wrapper

I have made a Point2D.Double wrapper so I can add my own functionality (like a dominate method) and alter some (like ...
5
votes
1answer
365 views

Python wrapper for official Hacker News API

Since Hacker News launched their official API, I started working on Python wrapper for it. API v0 is fairly simple, you send a GET request with hacker news story's ID or user id, it returns data in ...
3
votes
1answer
3k views

A wrapper class for Sessions in PHP

I have been using $_SESSION, $_POST, $_GET, $_SERVER ...
4
votes
1answer
72 views

Thin proxy class for hashables

I need some kind of thin wrapper object to mark dictionary keys, like: d = { Required('name'): str, Optional('age'): int, } And these wrappers should behave ...
6
votes
1answer
388 views

Debug log wrapper

I will be adding functionality and most likely additional refactoring, however a stringent review would be welcome before I build it further. I know documentation is probably a bit sparse but, you ...
11
votes
2answers
3k views

Async wrapper around public API

Tear it apart. I'm mostly concerned around the appropriate use of ConfigureAwait(false), and possible poor handling and duplication of the ...
3
votes
1answer
365 views

Neo4J Rest Javascript wrapper

As a toy project, I started evaluating the Neo4J graph database and its Rest interface. I'm trying to write a simple graph visualization in JavaScript. In daily business I'm a Java developer and maybe ...
11
votes
1answer
567 views

Set of wrapper functions for POSIX signal APIs on Linux

Please feel free to comment on the accuracy/validity of the following wrapper source for processing signals using the new POSIX sigaction API. If you feel I'm doing anything wrong or potentially ...
10
votes
1answer
362 views

Correct usage of alignas in std::ostringstream wrapper

Please take a look at this code: ...
7
votes
1answer
2k views

OpenGL object wrapped in a Qt Widget

I have this object wrapper class, which I will use to implement my Qt OpenGL scene. It is working, but I am looking for a way to: Improve the API. Remove extra OpenGL calls. Optimize it. I know that ...
4
votes
1answer
1k views

PHP wrapper around an API - best practices

Here's a PHP wrapper around a public OAuth2 REST API. I would love to hear your thoughts and comments. Testing was a bit frustrating since I tried for my first time. Not sure if I have done the ...
3
votes
2answers
1k views

Structure of API wrapper

I'm building an API wrapper for a bookkeeping SOAP API. I have some questions regarding bast practice for structure of the wrapper and for error handling. For now i've structured it like this: ...
4
votes
1answer
4k views

Creating a reusable C#.NET Oracle Query Builder

I write a metric ton of queries for an Oracle environment every day. These are reports that often require multiple separate queries that no end of joins and sub-queries will satisfy, hence lots of ...
6
votes
2answers
694 views

Critique of realloc() wrapper

Seeking code correctness and best practices. I would like to re-allocate various amounts of memory (0 or more) such that on systems that may return NULL for an ...
5
votes
2answers
5k views

Wrapper around default shared preferences in Android

Retrieving an instance of (Default) SharedPreferences and then calling the six methods that may be called to put/get a value gets pretty old pretty quickly, so I ...
1
vote
1answer
727 views

Wrapper for caching methods in ASP.NET

I have written a caching wrapper method for some of my services. The actual wrapper method is written as follows: ...