abstraction

Database Abstraction in a Reporting Application

In a reporting application, Is it possible to abstract reporting logic and the database schema details? I have a Reporting Services application with a reasonably complex reporting logic, I am trying to migrate the application to some other databases. (Databases that are built for the same purpose but developed by different software-hou...

Is knowing some basic low-level stuff essential to all programmers?

Should all decent programmers be expected to know at least something about low-level stuff such as the following: The gist of how garbage collection is implemented, how memory management works without GC, and exactly what the difference is between the heap, the stack and the static data segment? At least be able to read assembly langua...

How much low-level stuff to expose in an API?

When designing the public API of a generic library, how much of the low-level stuff that's used internally should be exposed? On the one hand, users should not depend too heavily on implementation details, and too many low-level functions/classes might clutter the API. Therefore, the knee-jerk response might be "none". On the other ha...

Get Entity From Table Using Reflection From Abstract Type

Ok, so I have an abstract class called Product. I have 3 tables called Items, Kits, and Packages that implement Product. Product has a public property that exposes the object's primary key. That said I have a form where I pass a product. I would would like to pull that product out of a fresh datacontext without having to write a big ...

Exception to the Law of Leaky Abstractions

I've had an argument with a friendly coder who was mildly damaged by Joel's Law of Leaky Abstractions. It is very hard to convince him of using any new framework/toolbox at all. I'm trying to present a point where "abstractions are fine as long as they allow low-level access to abstracted level". Examples: GWT - Google's superb Java-t...

Anyone know of an abstraction layer for JavaScript libraries for common tasks?

I know, I know, another layer on top of the libraries, but I think there could be some benefits when it comes to porting certain functionality. I thought I would ask and see if anyone has found anything related to this. Essentially it would be a bunch of getters and setters, and any one of the major libraries could sit inbetween. Has any...

Abstract Enum selection box

I'm trying to make a function that can take an enum type, display all the possible selections to the user, let them select one and then pass it back. Generics don't allow you to limit to enum. I've got code working that will cast back and forth, but I'd like it to accept and return the same enum type. This code works but not as well as ...

Where do all "bulk" operations belong in DDD?

In DDD one of the key concepts is Repository, which allows you to retrieve Entities (or Aggregate Roots) and then save them back after they are updated. Let assume that we need to perform some 'bulk' operation with entities, and the number of entities makes it absolutely impossible to retrieve them into memory. I.e. operation can only b...

Why should I use a human readable file format?

Why should I use a human readable file format in preference to a binary one? Is there ever a situation when this isn't the case? EDIT: I did have this as an explanation when initially posting the question, but it's not so relevant now: When answering this question I wanted to refer the asker to a standard SO answer on why using a human...

Can anyone point me to a good article on "abstracting HTML"?

I'm currently working on a legacy eCommerce system front-end that has alot of duplicate HTML code. I'm trying to find a way to abstract out the complexity almost as you would when moving the similarities between similar classes into a shared abstract base-class. I.E. "Taking out what changes and abstracting it" I've used Java framew...

A brilliant example of effective encapsulation through information hiding?

"Abstraction and encapsulation are complementary concepts: abstraction focuses on the observable behavior of an object... encapsulation focuses upon the implementation that gives rise to this behavior... encapsulation is most often achieved through information hiding, which is the process of hiding all of the secrets of object that do no...

Why are interfaces preferred to abstract classes?

I recently attended an interview and they asked me the question "Why Interfaces are preferred over Abstract classes?" I tried giving a few answers like: We can get only one Extends functionality they are 100% Abstract Implementation is not hard-coded They asked me take any of the JDBC api that you use. "Why are they Interfaces?". C...

Hard coding vs Generic coding : Where to draw the line?

I'm not exactly sure how to word this but I'll try. Suppose you have some settings in some piece of your program where your 80% sure you won't ever have to modify again. How do you know where to draw the line on changeable code? You know that taking the settings all the way to a user defined XML file is overkill. However, you also...

What are some famous abstractions in programming languages?

For my computing languages class, we've been assigned to read On the Design of Programming Languages by Niklaus Wirth. One of Wirth's main points is that programming languages should choose a few abstractions and stick with them. I'm trying to brainstorm some more modern examples than the ones that Wirth gives (although they don't nece...

How to code inlineable mutual abstracion in C++ ?

Example first: template <class HashingSolution> struct State : public HashingSolution { void Update(int idx, int val) { UpdateHash(idx, val); } int GetState(int idx) { return ...; } }; struct DummyHashingSolution { void UpdateHash(int idx, int val) {} void RecalcHash() {} }; struct MyHashingSolution { void Upd...

System.Web.Abstractions: what is it good for?

... absolutely nothing? What part of the puzzle does it fill for ASP.NET WebForms and ASP.NET MVC respectively? Can you somehow create a ASP.NET * base-application which uses System.Web.Abstractions so it can be used in both kinds of ASP.NET-web applications? In that case, how did they retro-fit the classes in System.Web.Abstractions ...

difference between abstraction and encapsulation?

What is the precise difference between encapsulation and abstraction? ...

What's the best way to abstract the database from a PHP application?

My question is how does one abstract a database connection from the model layer of an application? The primary concern is to be able to easily change from different types of databases. Maybe you start with a flat file, comma-delimited database. Then you want to move to a SQL database. Then later you decide an LDAP implementation would be...

What should i use : functors, interfaces or abstract methods when writing an abstraction(compatibility) layer? (D language)

For example: a compatibility layer between scripting objects (like strings, arrays) or scripting engines( eval() ,readFile() etc.). ...

Primitive vs Abstraction when designing library API

In this video after approx 35 minutes Krzysztof Cwalina (Micrsoft's .NET Framework Program Manager) talks about distinguishing library, abstraction and primitive types in their design process. Examples of each: Library types are at top layer: Diagnostic.Debug, EventLog Primitive types are at bottom, have minimal interface and suppose...