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 votes
1 answer
230 views

I'm currently developing an SaaS application in PHP, with Laravel, using its own DB class. Let's pretend we've got 2 classes under 2 namespaces, plus Laravel's own DB - so Illuminate\Support\Facades\...
XLR's user avatar
  • 111
22 votes
7 answers
9k views

I've heard the phrase being thrown arround and to me the arguments sound completely insane (sorry if I'm strawmaning here, Its not my intention), generally it goes something along the lines of: You ...
James's user avatar
  • 347
2 votes
2 answers
6k views

I know that the following function is a virtual function and needs to be overridden when extended by another class: virtual int getAge()=0; What i don't understand is the following syntax I have ...
joes's user avatar
  • 49
-3 votes
3 answers
1k views

I was hoping that someone could explain to me in the simplest way possible and with an example, what abstraction is with regards to Oop. I've read articles online and I just don't get it. I'm hoping ...
CodeLearner's user avatar
17 votes
5 answers
2k views

When looking at a new codebase I like to start from a bottom-up approach. Where I comprehend one file and then move up to the next abstraction. But often times I find myself forgetting what the ...
John DeBord's user avatar
0 votes
1 answer
4k views

I need to make a sponsorship system with complex business requirements. Basically, after a user makes a payment, the system should get triggered. There are many different types of sponsoring, so I ...
Steve Chamaillard's user avatar
-2 votes
1 answer
122 views

I just wanted some feedback on my definitions of these terms. Abstraction - only showing relevant information and hiding implementation details. Interfaces and abstract classes are an examples of ...
BIGJOHN's user avatar
  • 117
2 votes
1 answer
2k views

I love the Material-UI library, but some things that I've found annoying: I find Typography too long to write out, especially when I'm having to specify things like gutterBottom, align, etc. Whereas &...
dwjohnston's user avatar
  • 2,769
1 vote
2 answers
221 views

Say you have a HomepageController that' suppose to show all the blogs, users, gallery, and some members-only info (for logged-in users) Normally, it looks like this: <?php class ...
IMB's user avatar
  • 343
2 votes
2 answers
645 views

I was reading this page and came across this sentence in the accepted answer: I don't like A directly knowing about B. But that's a DIP thing not a POJO thing. What if you can't abstract out B so ...
user avatar
3 votes
4 answers
1k views

After an unresolved argument with a friend I decided to ask the stack overflow community. Is there something like abstracting your code too much? Which of the following is the better option. We come ...
Brendon Grundlingh's user avatar
5 votes
2 answers
10k views

I recently started working on an existing project written in C++ Builder. The application consists of a MainModule that loads lots of modules (DLLs). The MainModule itself is a DLL (there is a small ...
Error - CPU Not Foud's user avatar
-1 votes
1 answer
360 views

Lets say i am following Repository pattern in my application and i have class UserEntity { private $model; public function __construct() { $this->model = new UserModel(); } }...
ujwal dhakal's user avatar
0 votes
1 answer
82 views

I am looking for an abstraction from which to solve a class of problems similar to the following: I have this ordered ResultSet (in this case sorted for NATION,REGION,DISTRICT,COUNTRY): CITY' Table ...
Forcuti Alessandro's user avatar
6 votes
2 answers
2k views

I have gone down the rabbit hole that is abstracting away a working game engine in OpenGL and C++. Before reaching the other side I'd like to ask about my current design, which is - the more I look at ...
Felix's user avatar
  • 387
1 vote
1 answer
438 views

This is regarding designing a search api. We have 3 tier architecture now using Spring MVC. All communications are via REST api. UI <-> Business <-> Data(sql). Now to implement faster ...
Renjith's user avatar
  • 123
30 votes
9 answers
12k views

I have read plenty of articles recently that describe primitive obsession as a code smell. There are two benefits of avoiding primitive obsession: It makes the domain model more explicit. For example,...
w0051977's user avatar
  • 7,139
4 votes
4 answers
2k views

Please see the code below: public class Customer { private readonly IList<Order> _orders = new List<Order>(); public string FirstName { get; set; } ...
w0051977's user avatar
  • 7,139
-1 votes
2 answers
198 views

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 ...
thexeno's user avatar
  • 117
-1 votes
1 answer
839 views

How are variables abstractions for the memory cells of the machine? Is it because you can change the value stored in the memory cell by assigning a different value to the variable associated with the ...
blah's user avatar
  • 21
-2 votes
1 answer
102 views

In a recent MVVM mobile app project I wrote a set of API classes and Database classes where there was a clear flow of logic between both api and db code. To enforce the way api and db interacted I ...
Roland's user avatar
  • 99
1 vote
1 answer
106 views

I want to implement an abstract module to store credits and I have the following structure: Model: Credit (abstract) Dao: CreditDao (interface) Service: CreditService The Credit model should be ...
Mallorca Software's user avatar
3 votes
2 answers
2k views

I've been watching an presentation from Jonathan Blow on Software Quality. He as a point that adding more and more layers of abstraction gives you not only more difficulty to manage your code, but ...
microo8's user avatar
  • 147
0 votes
2 answers
10k views

I have a class that I usually end up calling XManager. This class usually acts a dispatcher. Where it will read a config and do what the config says. Assuming that I have the following class ...
lilott8's user avatar
  • 111
31 votes
11 answers
7k views

How can I tell my software has too much abstraction and too many design patterns, or the other way round, how do I know if it should have more of them? Developers I work with are programming ...
Daniel W.'s user avatar
  • 555
0 votes
2 answers
99 views

let's say that I am working with an IoT device. The device can have many sensors, each of them has an address, i/o direction and a reading method. temperature=d2,input,digital humidity=d3,input,...
user avatar
1 vote
2 answers
217 views

Just like the two opposing mirrors are enough for infinity, most of design patterns can be applied repeatedly producing any amount of LOC desired. We can always create a factory for any factory or ...
h22's user avatar
  • 966
3 votes
3 answers
1k views

I'm reading the book "Agile Software Development, Principles, Patterns, and Practices" by Robert C. Martin. When he talks about the Dependency Inversion Principle he gives the following example of a ...
Melvin Koopmans's user avatar
0 votes
2 answers
576 views

Edit: the difference between my question and What are the differences between abstract classes, interfaces, and when to use them, What are abstract classes and abstract methods? is that the chosen ...
NingW's user avatar
  • 269
1 vote
1 answer
125 views

There is a @Mark Seemann's cite from a conversation which states that an abstraction must never implement IDisposable: I like how @nblumhardt put it almost six years ago: an interface [...] ...
Serhii Shushliapin's user avatar
-2 votes
1 answer
613 views

This page on JS Promises says it is a software abstraction. What is a software abstraction and why is the JS Promises called software abstration?
wonderful world's user avatar
1 vote
2 answers
632 views

Up to now, I was considering MySQLi functions in PHP one example of DAL. And I initiated a simple project to publish in an article with the title "starting with PHP and DAL and MySQL" But when I made ...
rmagalhaess's user avatar
0 votes
2 answers
938 views

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 ...
Piotr's user avatar
  • 151
-3 votes
1 answer
2k views

I wrote abstract base for some turn-based games (like chess or tic-tac-toe) and wrote game based on this base. And I stuck with choosing how to design class hierarchy. Here is two variants for wich I ...
KgOfHedgehogs's user avatar
-2 votes
2 answers
534 views

Abstraction - Creates barrier between representation & usage of List ADT Encapsulation - Ensures maintaining in-variants of List ADT. An invariant is a fact about a data structure that is ...
overexchange's user avatar
  • 2,325
8 votes
3 answers
30k views

If I have an abstract class Drink which has a derived class Coffee, what would the copy constructor for Coffee look like? If it accepts a reference of Type Coffee as a parameter then I wouldn't be ...
FoxTrod's user avatar
  • 83
4 votes
1 answer
165 views

The gist of what I'm trying to do is get an instance of the appropriate user service, then pass it whatever subtype of User we're working with. Models: public class User { public string ...
Eric Eskildsen's user avatar
3 votes
2 answers
3k views

I'm trying to figure out how to create abstraction over different APIs, which have common things. For example let's take the mobile platforms you have Android, Windows Phone and IOS. Let's say I want ...
nameLess's user avatar
  • 129
-1 votes
1 answer
428 views

i have a question about software engineering best practice. Let's consider a class "User", with 2 subclasses "Student" and "Teacher" if we need to specify some data for "University special council" ...
antolaravel's user avatar
1 vote
1 answer
133 views

I am new to OOP. I've read definiton of both terms in many different articles and books, but still can't understand whether there is any relationship between them.
saidfagan's user avatar
  • 123
3 votes
1 answer
575 views

Take the following sequence of events: Business layer requests data x and y from data layer. Data layer returns version 1 of x and y. Business layer starts performing logic based on data x and y. ...
Snixtor's user avatar
  • 211
0 votes
1 answer
107 views

I am not sure how to phrase this. I believe this should have been asked somewhere, but I am unable to find it because I don't know the keywords. Basically, I have some types like this: interface Foo ...
SOFe's user avatar
  • 728
5 votes
1 answer
990 views

I am wondering if there is anything wrong with creating generic actions in redux which dynamically change different properties in the store , so that i can reduce boilerplate code. For example: //...
Mr. MonoChrome's user avatar
0 votes
1 answer
57 views

I am wondering if there is a specific term for when multiple representations are data equivalent. Meaning that you can transfer the data from one representation to the other without any loss of data. ...
Tormod's user avatar
  • 379
8 votes
4 answers
2k views

Reminder: If you have tips, please remember to put the reason objectively, such as "having two distinct SetInt() functions in the same file violates reader expectations that they'll be overloads, and ...
piojo's user avatar
  • 269
32 votes
13 answers
5k views

Until now, I always believed that you should learn programming languages that make you do low-level stuff (e.g. C) to understand what's really happening under the hood and how the computer really ...
lightning_missile's user avatar
1 vote
1 answer
436 views

This question was answered in "Understanding Abstract Data Types (ADTs)", and the top voted answerer (by Frank Shearar) is currently as follows: Objects are not ADTs (*) [editor's note: Links to "On ...
LMZ's user avatar
  • 119
-1 votes
1 answer
825 views

I'm building a model of the SQL query language. It doesn't attempt to abstract SQL at all - instead, it tries to model it directly, so it has model objects named Query, Table, Column, Variable, ...
mindplay.dk's user avatar
  • 1,707
1 vote
0 answers
147 views

I have a couple wrappers around third party APIs that allow me to retrieve information from certain web services. Querying these services can be rather time intensive, so in my older version of my ...
JD Davis's user avatar
  • 1,387
1 vote
1 answer
199 views

I'm working on refactoring a synchronization web app that our company uses. Currently it's merely a set of controllers that fire up a set of helpers that go through a long chain of if-else type ...
JD Davis's user avatar
  • 1,387