Skip to main content

Questions tagged [abstraction]

Use this tag in reference to either hardware abstraction, such as how Windows can use the same APIs even on different hardware, or any other method where the reality is separated from the user-level programs by software. This should not be used for emulation.

Filter by
Sorted by
Tagged with
1 vote
5 answers
390 views

Consider that I've implemented SHA-256 hashing in C as incrementally updated IUF (init-update-finalize) working context and 3 subroutines. To use it in free-standing environment, or to efficiently use ...
DannyNiu's user avatar
  • 374
2 votes
2 answers
426 views

Disclaimer: I am learning unit testing. I am also kind of beginner in object-oriented design. Currently, I am involved in the development of an application to manage the finance of a humble food ...
Siva Sankaran's user avatar
5 votes
1 answer
576 views

Using assimp I've created a function to load 3D models and it does everything I need and I don't plan to use another library or write something custom, however, I am curious how techniques such as ...
Konjointed's user avatar
2 votes
3 answers
359 views

I know there are some posts talk about primitive obsession : When is primitive obsession not a code smell?, Is "avoid the yo-yo problem" a valid reason to allow the "primitive obsession&...
wcminipgasker2023's user avatar
3 votes
3 answers
2k views

I have many abstract classes that describe many abstract ideas and objects. These classes have many complex relationships with each other, and I realize that while writing code with some of the ...
nreh's user avatar
  • 161
-2 votes
1 answer
863 views

I have been struggling with how to create an "object-oriented" cross-platform abstraction. In C++, a class requires a certain amount of coupling between its interface (i.e., public methods) ...
Patrick Wright's user avatar
0 votes
1 answer
166 views

Having a poor knowledge of the extended features of the available message brokers, I was wondering how to approach this. We have some environments where only RabbitMQ is available, others where ...
kant312's user avatar
  • 111
1 vote
2 answers
246 views

I like programming in such a way that every component/injectable of the applications I build, has a clearly defined scope, and it's easily tested. With years working as a Developer I've come to ensure ...
caeus's user avatar
  • 129
0 votes
0 answers
234 views

I am going to type out my problem in terms of my domain use case; When an Operator has an Ingest with a valid Dataset (Lowside, Drive and EntryPoints selected), they will opt to then Scan the Ingest. ...
Patrick Christie's user avatar
2 votes
2 answers
263 views

I have an intuition, that I'd like to read what others have talked about. To me, it seems fairly intuitive that when you have a function which is called multiple times with the same arguments, it ...
Thiago Pereira Maia's user avatar
1 vote
2 answers
283 views

I'm a junior web developer. My current work is on a form-based server side web application. It was set up using jQuery. I'm now the primary person working on it. In a previous job, which was more ...
pikachu's user avatar
  • 19
16 votes
7 answers
5k views

One thing I've long struggled with being able to grasp properly is, when designing a program in an object-oriented language, where and how should explicitly named/defined interfaces be added? In ...
The_Sympathizer's user avatar
0 votes
2 answers
149 views

So I've got a class that calculates a discount (Let's call it class "A"). It has a price fetcher class as a dependency (constructor injection) (Class "B"). The price that is ...
pro100tom's user avatar
  • 449
0 votes
0 answers
69 views

I'm writing a Hardware Abstraction Layer (HAL) to abstract a hardware peripheral on an mcu. The driver peripheral looks like this. Driver module. Includes hal.h void drv_init(void); void drv_set(int x)...
ProgrammingPort022's user avatar
1 vote
2 answers
332 views

I'm developing a full-stack Rest application following a narrative description of a working context. There is a class Job with two subclasses Job_A and Job_B. Job_A produces Report_A while Job_B ...
Wippo's user avatar
  • 119
0 votes
1 answer
217 views

Assume a low-level API is provided without source code (e.g. DirectX). The API provides a virtualization of hardware resources (GPU, CPU, audio card, etc.), which enables the user to call hardware-...
chckx592's user avatar
0 votes
1 answer
3k views

My question is about DDD, the Infrastructure layer, it's relation to the Domain, and specifically how we can take advantage of the ability to "swap out" one persistence implementation for ...
apriestley's user avatar
5 votes
2 answers
224 views

I am writing a library to allow two people to play chess for a toy project. For what is worth, it is in C++. I have deemed useful to have a class named Move, which represents a move which needs to be ...
user2891462's user avatar
0 votes
2 answers
533 views

I'd like to design an implementation for graphs in C. I'm wondering what the most efficient approach in terms of both computational power and memory consumption would be. I've looked at various open-...
j3141592653589793238's user avatar
0 votes
3 answers
276 views

I have some code where I believe the SLA (single level of abstraction) principle is broken in a way that the low-level code (if-statements) is outside and the high level code is nested inside the ...
Thomas Weller's user avatar
-1 votes
1 answer
234 views

My goal is to define a Service class which process method accepts a RequestType argument that is defined by the contained ServiceType and returns an object of a type defined by ServiceType. By doing ...
Antonio Santoro's user avatar
0 votes
2 answers
358 views

I am creating a bank software system. In this system, there are 3 account types: Savings, Checking, CD. Each account from any type has an ID, apr, and amount, and we can withdraw from it. So I can ...
X Y's user avatar
  • 321
1 vote
4 answers
199 views

In a program there is an abstraction from an person to a shape. This abstraction is so that collision detection can be performed. Here is my original class hierarchy: namespace Graphics { class Shape ...
user avatar
2 votes
2 answers
307 views

Some classes have methods that don't match up with procedural data abstraction. Here is an example of a problem hierarchy, the Render() method doesn't seem to be part of an procedural data abstraction ...
user avatar
1 vote
2 answers
457 views

I know this is a very basic topic, but I'm curious why an abstraction in programming is always defined as a simplification/hiding of some functionality. Let's say I wrote a set of functions that let ...
Wojtek Wencel's user avatar
3 votes
5 answers
451 views

I learnt the concept of abstraction as: Reducing complexity by hiding unnecessary details. Does this have a relationship with the abstract keyword in java? I see that the abstract keyword is being ...
Jandroid's user avatar
  • 140
1 vote
0 answers
102 views

Intro I'm creating an app and I'm not sure if the structure of the solution is correct. I have a BaseController that uses generics. This controller is inherited by others that do not have to ...
Emily's user avatar
  • 19
4 votes
1 answer
219 views

As an example, let's assume our application needs some way to communicate with other systems using HTTP. interface HttpClient { fun <T> get(url: String, returnType: Class<T>): T fun ...
enp4yne's user avatar
  • 149
-4 votes
1 answer
581 views

Goal: write code to express SQL queries in C# that get converted to SQL at the data layer level and will be compatible with any common data layer / ORM such as Dapper or Entity Framework (EF). Edit: ...
Christian Findlay's user avatar
0 votes
1 answer
195 views

In the realm of OOP, inheritance, abstraction and polymorphism are basic concepts of the paradigm. On top of that, there also have the concept called "associations" which I understand is ...
Steve.NayLinAung's user avatar
1 vote
1 answer
138 views

I am working on a hobby project of mine where I want to make an application to doing my personal finances. Just for learning. I am trying to adhere and implement best practices and patterns to learn ...
avanwieringen's user avatar
2 votes
4 answers
2k views

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 ...
mdx's user avatar
  • 213
1 vote
1 answer
504 views

I am trying to get myself familiarized with the design patterns and I am reading through this line on the relationships between different patterns. I cannot get my head around this one though, You ...
Sen's user avatar
  • 19
1 vote
1 answer
1k views

+-------------+ +--------+ +----------+ | repository +-------->+service +------->+controller| +-------------+ +-^------+ +------------+ +-------------+ | ...
poppycockears's user avatar
0 votes
2 answers
156 views

In a large iOS application, I have a database module which is dedicated to handle application databases with read/write public APIs for other module. UI module has a feature to share the database, in ...
Sazzad Hissain Khan's user avatar
37 votes
10 answers
7k views

Suppose I'm creating a game played on a 2D coordinate grid. The game has 3 types of enemies which all move in different ways: Drunkard: moves using type 1 movement. Mummy: moves using type 1 movement, ...
Frank's user avatar
  • 481
1 vote
1 answer
167 views

It appeared, that I have in my pet project two abstractions: asset loaders and drawing tasks. For each abstraction I have some classes representing them (currently a single class for drawing task ...
Yaroslav Kishchenko's user avatar
3 votes
3 answers
335 views

I have some years of oop programming experience,I though I know what abstraction is (using abstract class and interface), but I am confused with the definition that appear in a book which says: "The ...
secondimage's user avatar
6 votes
2 answers
663 views

I like to invert dependencies whenever possible by depending mostly on abstraction and allowing the concrete implementations to be passed into the object by clients, or a factory. I've found this to ...
Ryan Palmer's user avatar
0 votes
2 answers
111 views

Python, has the library pathlib with the concrete class Path. I have a class called Cleanup, that looks like this: from pathlib import Path Cleanup: def __init__(self, source : Path, ...
user avatar
1 vote
1 answer
140 views

I am looking at designing a Graph class, that should work for both lists and matrix. For ex: something like, class Graph { public: virtual ~Graph() = 0; virtual bool AddEdge(int src, int dest)...
vinit's user avatar
  • 131
3 votes
2 answers
686 views

I thought I understood what abstraction meant - refactoring code so that it applies to more general use cases. However I have recently learned that some types of abstraction may actually be ...
drenl's user avatar
  • 167
13 votes
5 answers
5k views

I'm facing problems with what I feel is too much abstraction in the code base (or at least dealing with it). Most methods in the code base have been abstracted to take in the highest parent A in the ...
YamizGers's user avatar
  • 147
1 vote
7 answers
723 views

At my current company, the project I work on is coded in Java, at least for the systems / backend part. Whenever I get assigned a task dealing with the Java code, it take me hours or even days to ...
henhen's user avatar
  • 149
0 votes
1 answer
276 views

I've run into this issue a few times. I have preexisting framework objects that do not share a common ancestor. An example of this would be a class representing a an environment variable and a class ...
Sidney's user avatar
  • 181
1 vote
2 answers
196 views

I've been learning object-oriented concept from this book, and stuck in a specified concept in the middle of chapter 6. No one could understand my question without brief prologue, so I'm starting with ...
Andy Lin's user avatar
  • 185
2 votes
4 answers
306 views

I understand the principles behind opaque data types, encapsulation, information hiding, etc. in theory: preventing alteration to parts of a program can prevent people from accidentally messing it up, ...
Nicholas's user avatar
  • 163
0 votes
2 answers
294 views

I need to create a program to manage an association. Members of this association have different roles and each role has specific characteristics. My problem is that I'm not able to abstract this ...
Concy's user avatar
  • 59
10 votes
5 answers
4k views

I am reviewing a colleague's code and as part of the changes, this person introduced a few new pure data classes like so (C#): public class Result : IResult { public bool Succeeded { get; set; } ...
Logan S.'s user avatar
  • 209
2 votes
1 answer
369 views

I'm writing a program that will interface with an external device. It will support numerous devices that may use different communication interfaces like USB, serial, etc. This is what I have so far: ...
John O'brien's user avatar

1
2 3 4 5