Questions tagged [wrapper]
The wrapper tag has no usage guidance.
21
questions
0
votes
1
answer
53
views
Wrapper Auxiliary Method VS Default Arguments for Initialization: Pros/Cons
I have a class in which there are several methods that can act as an "entry point" to its private innards (or the "fruit" thereof).
Said functions might be called multiple times ...
1
vote
1
answer
143
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
93
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
4k
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
1k
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
388
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
667
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
54
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
271
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
2k
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
3k
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
179
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 ...
3
votes
3
answers
718
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
141
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
851
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 ...