The abstraction tag has no wiki summary.
1
vote
3answers
59 views
Designing a SQL-like encapsulation object for programmatic use
In the last few weeks, I have been working on a Data Mapping Library, which has involved lots of research, experimentation, crying, blaming the whiteboard for not being big enough, and more research. ...
0
votes
0answers
126 views
Is the code reuse worth abstraction that is less flexible?
I have a bunch of state objects that can be added or removed from a model, with two approaches for how to handle the adds and removes. I wanted to see which, if either, feel like a better approach.
...
8
votes
3answers
406 views
Refactoring an existing abstract class and its parameters
I have an abstract class A which declares an abstract method doStuff. Currently there are many classes that inherit from A and implement doStuff.
The class' instances are initialized at run-time ...
3
votes
0answers
214 views
Is this over-abstraction? (And is there a name for it?)
I work on a large Django application that uses CouchDB as a database and couchdbkit for mapping CouchDB documents to objects in Python, similar to Django's default ORM. It has dozens of model classes ...
4
votes
2answers
291 views
Is there a name for being able to quickly find the relevant code?
I notice that a property of codebases that I like hacking on is that it's quick to find the relevant code for some feature, without knowing much about the code base at all. For example, searching for ...
7
votes
5answers
736 views
Why does Java use so many middlemen? [closed]
For example to read data from a website we do:
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = ...
1
vote
1answer
114 views
Using a DAO to abstract our ORM from the rest of the application
We're using MySQL with Sequelize.js as the ORM.
What we're wondering is whether a DOA layer of abstraction is worthwhile. Here are our options:
To use the Sequelize models throughout the ...
-5
votes
1answer
119 views
An Abstractionist that seeks to become an implementationst [closed]
I'm an abstractionist (I suppose), I am not very fond of implementing things unless they pose some challenges other than Do-It-Fast, rather I very much enjoy refactoring the code, viewing it from some ...
10
votes
6answers
516 views
What changes are too big to be made easy by proper design?
This is a rather vague question, but it's something I've never felt has been answered in a satisfactory way when reading about proper design.
Generally, when learning about Object Oriented ...
19
votes
6answers
1k views
Do frameworks put too much abstraction?
I've been programming for a little under a year and have some experience writing systems applications, web apps, and scripts for businesses/organizations. However, one thing I've never really done is ...
8
votes
11answers
3k views
Why do “data types” in computers exist, if it's really all just bits? [closed]
I am confused with the wide array of ways to implement existing data types in hardware as it all seems a bit illusory.
For example:
There's no such thing as a software stack or a hardware stack; a ...
7
votes
3answers
105 views
Rules about the concreteness of method parameter types, return types and property types
Some time ago I read a kind of "rule of thumb" about the concreteness of method parameter types, return types and property types, but I just do not remember it.
It said something about keep your ...
2
votes
1answer
232 views
What kind of abstraction/SoC should I use here?
I am starting a new project, and I want to follow the separation of concerns pattern, and I have been reading on the topic, and now I am in doubt of how I should go about this.
Here is how I ...
5
votes
2answers
213 views
How does strengthening of pre conditions and weakening of post conditions violate Liskov Substitution principle?
I read that Liskov substitution principle is violated if :
Pre conditions are strengthened .
Post conditions are eased out.
But I don't get fully yet how these two points would violate Liskov ...
-1
votes
3answers
196 views
How flexible can hardware get? [closed]
This subject is long time in the making for me and it particularly took off when I was researching bootloaders for computers and consumer electronics, which, I will note, differ drastically. I've ...
8
votes
4answers
358 views
Should database queries be abstracted out of the page itself?
When writing page generation in PHP, I often find myself writing a set of files littered with database queries. For example, I might have a query to fetch some data about a post directly from the ...
12
votes
1answer
384 views
Why doesn't Haskell have type-level lambda abstractions?
Are there some theoretical reasons for that (like that the type checking or type inference would become undecidable), or practical reasons (too difficult to implement properly)?
Currently, we can ...
5
votes
1answer
244 views
Abstract Factory Method and Polymorphism
Being a PHP programmer for the last couple of years, I'm just starting to get into advanced programming styles and using polymorphic patterns. I was watching a video on polymorphism the other day, and ...
3
votes
2answers
290 views
Too complex/too many objects?
I know that this will be a difficult question to answer without context, but hopefully there are at least some good guidelines to share on this. The questions are at the bottom if you want to skip the ...
0
votes
1answer
132 views
Is there a way communicate or measure levels of abstraction?
I'll be the first to say that this question is a bit... out there. But here are a couple questions I bear in mind :
Is abstraction continuous or discrete?
Is there a single unit of abstraction?
...
1
vote
3answers
187 views
Should I use an interface when methods are only similar?
I was posed with the idea of creating an object that checks if a point will collide with a line:
public class PointAndLineSegmentCollisionDetector {
public void Collides(Point p, LineSegment s) {
...
-1
votes
1answer
119 views
Using dot to Access Object Attribute and Proper abstraction
I have been programming in python and Java for quite a number of years and one thing I find myself doing is using the setters and getters from Java in Python but a number of blogs seem to think using ...
3
votes
2answers
201 views
I have data that sends in “bursts” of 100 records with a significant delay. How do I structure my classes for multithreading?
My datasource sends information in 100 batches of 100 records with a delay of 1 to 3 seconds between batches.
I would like to start processing data as soon as it's received, but I'm not sure how to ...
6
votes
1answer
291 views
Understanding the levels of computing
Sorry, for my confused question. I'm looking for some pointers.
Up to now I have been working mostly with Java and Python on the application layer and I have only a vague understanding of operating ...
4
votes
1answer
131 views
Is there a standard for machine-readable descriptions of RESTful services?
I've interacted with a few RESTful APIs that provided excellent documentation for humans and descriptive URIs, but none of them seem to return machine-readable descriptions of themselves.
It's not ...
4
votes
5answers
372 views
Should concrete classes avoid calling other concrete classes, except for data objects?
In Appendix A to The Art of Unit Testing, Roy Osherove, speaking about ways to write testable code from the start, says,
An abstract class shouldn't call concrete classes, and concerete classes ...
12
votes
10answers
1k views
What's the next level of abstraction? [closed]
Since programming languages initially only used lines of code executed sequentially, and it evolved into including functions which were one of the first levels of abstraction, and then classes and ...
2
votes
1answer
56 views
Reading data from file and const
Is it sane to let a read method on a file object to be const? For example
size_t read(void* buffer,size_t length) const;
The read method does not change the contents of the file, but updates the ...
3
votes
1answer
167 views
What technology/algorithm should be used to abstract meaning or keywords from a passage of text?
Hi and thanks for looking!
Background
I have a project wherein I need to abstract meaning from a passage of text to determine what the text is seeking and then match that text to a list of search ...
0
votes
1answer
332 views
An alternative to multiple inheritance when creating an abstraction layer?
In my project I am creating an abstraction layer for some APIs. The purpose of the layer is to make multi-platform easier, and also to simplify the APIs to the feature set that I need while also ...
4
votes
2answers
456 views
Is dependency injection by hand a better alternative to composition and polymorphism?
First, I'm an entry level programmer; In fact, I'm finishing an A.S. degree with a final capstone project over the summer. In my new job, when there isn't some project for me to do (they're waiting ...
5
votes
3answers
3k views
Abstract Data Type and Data Structure [duplicate]
It's quite difficult for me to understand these terms. I searched on google and read a little on Wikipedia but I'm still not sure. I've determined so far that:
Abstract Data Type is a definition of ...
-2
votes
2answers
221 views
Is it possible to increase the levels of abstraction I can hold in my head/reason about at once? How would I go about this? [closed]
I'd like to be able to read through fifteen pages of assembly code and know what it does. I'd like to be able to write programs that write programs that write programs that write programs.
We've ...
1
vote
2answers
200 views
Using macro as an abstraction layer
I am having a discussion with a colleague about using macro as a thin (extremely) layer of abstraction vs using a function wrapper. The example that I used is
Macro way.
#define StartOSTimer(period) ...
1
vote
3answers
582 views
Thick models Vs. Business Logic, Where do you draw the distinction?
Today I got into a heated debate with another developer at my organization about where and how to add methods to database mapped classes. We use sqlalchemy, and a major part of the existing code base ...
2
votes
2answers
137 views
Should Sequence Diagrams be Specific or Abstract?
I'm creating a sequence diagram for a simple program I'm working on for work. The diagram I'm currently working on is very high level - it defines the interface with lots of alt paths, but does not ...
7
votes
4answers
978 views
Abstract methods vs instance variables for reusable objects
I have quite a bit of Java code that I'm re-working to be re-used. The problem is that there are many pieces that are project specific so there are ends up being a higher level of coupling between ...
6
votes
4answers
445 views
Is rethrowing an exception leaking an abstraction?
I have an interface method that states in documentation it will throw a specific type of exception. An implementation of that method uses something that throws an exception. The internal exception ...
21
votes
17answers
1k views
What is the value in hiding the details through abstractions? Isn't there value in transparency?
Background
I am not a big fan of abstraction. I will admit that one can benefit from adaptability, portability and re-usability of interfaces etc. There is real benefit there, and I don't wish to ...
3
votes
3answers
473 views
Data Serialization to process business logic
Going by the general principle of data abstraction, I normally abstract data in a serialized format(JSON) and pass it as a parameter to the Business Logic(BL) modules such that the BL module always ...
3
votes
1answer
410 views
How is the facade pattern different from abstraction layers?
I just read about the facade pattern and found this example where a client (user of a computer) invokes a startComputer() method which calls on all the complex stuff:
Source: wikipedia
/* Complex ...
6
votes
2answers
331 views
What's the real benefit of meta-modeling?
After reading several texts about meta-modeling I still do not really get the practical benefit. Sometimes I think it is only an interesting mind game but no useful tool. Sure it is wise to clarify ...
1
vote
1answer
95 views
Munging intro level knowledge of set theory with intro level knowledge of electronics to parse and evaluate the content of HL7 messages
This question is being asked for the purposes of evaluating whether or not attempting to use things I picked up in college was a good idea, or even remotely defensible.
Last year I wrote a 'formula ...
11
votes
2answers
452 views
Is DDD-Lite a pattern language for dependency injection?
I stumbled upon Greg Young's talk 7 Reasons why DDD Projects Fail where he mentions something he calls DDD-Lite at 7:20.
Summarizing, he basically says some use DDD as a pattern languages (entities, ...
8
votes
3answers
558 views
How to determine the levels of abstraction
I was reading a book today called "Clean code" and I came across a paragraph were the author was talking about the levels of abstraction per a function, he classified some code as ...
8
votes
7answers
355 views
Is there a canonical book on general abstractions and modeling?
I've been trying to understand the fundamentals of general abstractions and modeling: there are quite a lot of books when you search for abstractions, but most of those seem to be about learning ...
4
votes
2answers
142 views
Does KISS encourage tools and frameworks that expose complex leaky abstraction layers?
Tools and frameworks make complex tasks simple. This seems like something that would be supported by KISS(keep it simple stupid). Tools and frameworks also have the potential to introduce leaky layers ...
3
votes
5answers
204 views
When to write Abstract code and when to be more specific?
I'm working on a small tool as a toy project to show the difference between two directories, showing which files/directories were added, removed, modified, etc.
I was trying to represent these ...
5
votes
3answers
635 views
Good use of wrapper functions?
What do you consider good use of wrapper functions? When are they useful abstractions and in what cases harmful and unnecessary complexity?
6
votes
1answer
248 views
Are “wrapper” and “shim” synonymous?
Are the words "wrapper" and "shim" more or less synonymous, or is there a distinction, perhaps connotative?
