Questions tagged [wrapper]
The wrapper tag has no usage guidance.
20
questions
1
vote
1
answer
94
views
Wrapper class for min/max clamping and validation
I have a lot of classes that have numeric values that are configurable by the customer during runtime and should be clamped between a min and a maximum value. The value changes should also be logged. ...
-2
votes
2
answers
86
views
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
3k
views
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 ...
2
votes
4
answers
691
views
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 ...
5
votes
4
answers
362
views
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
votes
1
answer
502
views
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
47
views
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 ...
0
votes
1
answer
246
views
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
1k
views
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 ...
12
votes
4
answers
2k
views
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 ...
-1
votes
2
answers
102
views
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 ...
2
votes
3
answers
495
views
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 ...
0
votes
1
answer
137
views
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 ...
-5
votes
1
answer
545
views
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
1k
views
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 ...
0
votes
1
answer
200
views
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 - ...
0
votes
2
answers
812
views
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 ...
15
votes
4
answers
1k
views
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
311
views
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
7k
views
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 ...