Questions tagged [wrapper]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
2 answers

Should I use an alias or a wrapper for an Integer type ID?

You have n lists, each serves as a global dictionary. Everything else is handled via IDs that represent the index in the appropriate list. Typically, this is some type of integer. However, trying to ...
10 votes
5 answers

C++ "Zero Overhead Principle" in practice

As an exercise in code architecture, I was writing a C++ wrapper for a window library called GLFW3. In this library, when a window's X button is pressed, you can register a callback that reacts to ...
  • 111
2 votes
4 answers

Wrapping 3rd party library - avoiding leaking abstraction

I'm currently developing an application using SFML. My biggest concern at the moment is making a layer of abstraction over the library, so I can easily change it to something else if needed. What I'm ...
  • 203
5 votes
4 answers

Stick with mis-named concepts or rename them in wrapper code?

I'm writing a library which includes some wrapper code for some underlying API. In that underlying API, there are two concepts, "foo" and "bar", whose literal meaning in the English dictionary is ...
  • 2,447
2 votes
1 answer

Should I wrap a 3rd party library?

I'm developing an application that manages many different components, including various objects in a Kubernetes cluster. There's a nice Java library to manage K8S objects, I use it to examine objects ...
-2 votes
1 answer

Should a CLI wrapper specify function defaults?

In my code let's say I have a function which does most of the work: def compute(x=3, y=5): ... And I have a CLI wrapper program using argparse. I intend end users to use the CLI program and not ...
  • 333
0 votes
1 answer

Improvements in a "data - manager - wrapper" architecture

I have programmed using the architecture below, where "client, order, piece" are just data classes, have no methods, and "managers" are the manipulators of that data, the "ClothingStore" is a wrapper ...
2 votes
2 answers

Wrapping 3rd party objects that are dependant upon each other and best practices

I'm having a bit of a moment of indecision here and I'd like some perspective on it. I'm currently wrapping up objects from a 3rd party API (at home for my own project and at work), and I'm doing my ...
  • 123
11 votes
4 answers

How do I wrap a service so it is simpler

We have a dependency to a third-party service which exposes a gigantic interface of which we only need like 3 methods. Additionally, the interface changes frequently... I've decided to wrap the ...
  • 329
-1 votes
2 answers

Firmware development philosophy in function wrapping

I wrote some code in the past for 8bit MCUs, realizing that every time I gained experience, the next iteration will be with a wrapper API or something more distant from the "bare metal" register ...
  • 109
2 votes
3 answers

Design tips: how to design a wrap class

I am using C# on a pretty huge solution that user a Static Class to manage the Session on the database. The performance are not so good because of the number of call to the database. The company ...
  • 704
0 votes
1 answer

Can a database wrapper be implemented in Scala using Traits? Is there a better way?

I've decided to implement a database wrapper to provide data operations of a web service using postgresql dbms. Models in my database are somelike complex and frameworks like slick do provide more ...
  • 152
-5 votes
1 answer

How to map an API into another one?

After some google search, I feel still in the mud. I am wondering whether what is the best approach for writing wrappers mapping two similar APIs that offer similar semantics but perhaps in different ...
0 votes
2 answers

Multiple layers of abstraction and chain calls of methods (Java functional like programming)

I am creating a multiple wrappers/layers API in Java that go like this public class Layer1<T extends Layer1> public class Layer2<T extends Layer2> extends Layer1<Layer2> public ...
  • 197
0 votes
1 answer

Should a Java wrapper around a 3rd party product's API be packaged as a Bean?

For the sake of personal use and for the educational reasons I wanna make a Java wrapper around a certain service's web API. That is, no additional software is required to use it on a client machine - ...
  • 101
0 votes
2 answers

Design pattern name for thin wrapper for unit testing purpose

Assuming I'm using a class from third party library that does not implement an interface, for example: class ThirdPartyLibClass { void DoThis() { ... } void DoThat() { ... } } I want to ...
  • 151
15 votes
4 answers

How can I reduce the manual effort for wrapping third party libraries with a larger object model?

Like the author of this question from 2012 and this one from 2013, I have a 3rd party library that I need to wrap in order to properly test my application. The top answer states: You always want to ...
3 votes
1 answer

Writing a non-monolithic database wrapper

I have a SQL database to which I store and from which I read several objects into my C++ code. I wrote a single database wrapper which handles all the reads and writes to the DB. Of course this ...
5 votes
4 answers

Avoiding hangs when calling a native API

Background We have a piece of programmable hardware here at work that we integrate into almost all of our systems. This piece of hardware came with a native Windows DLL (for which we do not have the ...
  • 2,728