abstraction

How many levels of abstraction do I need in the data persistence layer?

I'm writing an application using DDD techniques. This is my first attempt at a DDD project. It is also my first greenfield project and I am the sole developer. I've fleshed out the domain model and User interface. Now I'm starting on the persistence layer. I start with a unit test, as usual. [Test] public void ShouldAddEmployerToCollect...

How well does static code analysis work with Spring and other abstractions?

I'm in a situation where I'm required to make at least some effort to remove never-used code from my source code. The general preference is to use a static code analysis tool. We've had great luck with this in other projects, but the folks I hear from are mostly C/C++ developers working on device level code. I'm a web developer work...

Fatal error: Class NAME not found in (....PATH) ?

Hi What may be the problem if i get the following error. while i am extending a class i got this error example: class ModuleUser extends AbstractModule Fatal error: Class AbstractModule not found in (....PATH) ? I have done most of the possibilities... But i can't resolve the problem. any help will be thankful thanks n ad...

Abstraction of behavioural logic - is there a design pattern?

Hi all, I need to abstract some behavioural code and have a problem trying to reference the objects in the class that is calling these behaviours, let me try to explain: My "parent" class, has a property called CurrentPage. I also have some behavioural logic, that modifies the CurrentPage property, currently this is written in the same...

Objective-C, class abstraction and accessing those variables

I have a lot of experience with java and c++ development, so classes and abstracting data is pretty easy for me. I only started objective C a short time ago, and i was mostly working with in class globals, and everything was progressing smoothly. I just decided to abstract a large portion of my code in an effort to make it less spaghetti...

Singluar data-keys between application and database?

Is there a paradigm in which I can change a data-key name in one place and one place only, and have it properly be dealt with by both the application and database? I have resorted most recently to using class constants to map to database field names, but I still have to keep those aligned with the raw database keys. What I mean is, us...

Mysqli abstraction, fetching arrays from prepared statements

Lately I've stumbled upon an error in a lib that used to work just fine, and I'll be damned if I can figure out where it is. The code sample is below, and I apologize for the debug stuff that's inside it, but I'm trying to get it to work. The problem is that $temp is an array with correct key (the name of the columns) but all the value...

Cakephp: Abstracting AppController another level, possible?

Hi All, I was wondering if it's somehow possible to add another abstraction controller between AppController and my app's other controllers? So that my controllers, e.g. UsersController extends SecureController and SecureController extends AppController. Also I want to be able to have other controllers extend AppController directly: So...

Ruby abstraction

I'm new to Ruby, coming primarily from C# and ActionScript 3 (among other langauges). I'm curious about abstracting functionality. Specifically, wrapping and abstracting Ruby's FTP and SFTP libs. I was searching around and came across a gem called Backup. It really got my attention because it supports backing stuff up via S3, SCP, SF...

Subscribe a button to trigger some function dynamically in C++ ?

Hello, I'm trying to make a button class (abstract) so I can set what function is that button going to trigger when clicked dynamically when my program load. I want to construct all my buttons by reading XML files, this is to avoid code replication so having only 1 "generic" button class is really useful for me. I was wondering if you ...

Why don't numbers support .dup?

>> a = 5 => 5 >> b = "hello, world!" => "hello, world!" >> b.dup => "hello, world!" >> a.dup TypeError: can't dup Fixnum from (irb):4:in `dup' from (irb):4 I understand that Ruby will make a copy every time you assign an integer to a new variable, but why does Numeric#dup raise an error? Wouldn't this break abstraction, since ...

abstracting code from two methods in Java, maybe use delegates?

I have two methods that do essentially the same thing, just with different types. I want to abstract out this functionality to some generic method and I think I could do it easily in C# with delegates, but I don't know the equivalent in Java. I'm just showing two of the methods here, but there are several (like eight) different makeWha...

Java 1.6 abstracted random access.

As a java guru, what would you suggest to abstract random access so that a code can be agnostic to whether the data its accessing is in memory or in a file on the harddrive? (The files in question could be several gigabytes in size. Having random access is the most important feature.) ...

ASP.Net Page abstraction

We have a win application that shows a web form in a web browser. In order to get data from this web form we are using a hidden text box and get its text using HtmlDocument object of web browser control. I want to make an abstraction of this web form that has this text box element so that other forms can use this abstraction. I made a we...

Need derived class for java generics declaration

I've run into a sticky problem that I can't seem to solve with java generics. This is a bit complicated, but I couldn't think of a simpler scenario to illustrate the problem... Here goes: I have a Processor class that requires a Context. There are different types of Context; most processors just need any abstract Context, but others ...

View a vmdk file from Python?

Is there any way to view the contents of a vmdk file from Python, and to be able to read files from it? (I have no need to write to it). If not, is there any way to mount a vmdk file on a host machine, or generally any other way to look at a vmdk file without attaching it to a VM and running it? ...

What a single sentence consist of? How to name it?

Hi, I'm designing architecture of a text parser. Example sentence: Content here, content here. Whole sentence is a... sentence, that's obvious. The, quick etc are words; , and . are punctuation marks. But what are words and punctuation marks all together in general? Are they just symbols? I simply don't know how to name what a singl...

Is this a problem typically solved with IOC?

My current application allows users to define custom web forms through a set of admin screens. it's essentially an EAV type application. As such, I can't hard code HTML or ASP.NET markup to render a given page. Instead, the UI requests an instance of a Form object from the service layer, which in turn constructs one using a several RDM...

What is the benefit of a 'promise' abstraction in CommonJS?

I'm reading this article and the section on the promise abstraction seems a little overly complicated to me. The following is given as an example: requestSomeData("http://example.com/foo") // returns a promise for the response .then(function(response){ // ‘then’ is used to provide a promise handler return JSON.parse(respons...

Abstracting NSManagedObject and NSDictionary

In my project I have some objects that I show from a server, lets call them Foo's. When I get my Foo feed, I parse them into a NSMutableDictionary subclass called RemoteFoo, and pass these RemoteFoo objects all around the app to display data. If the user ends up wanting to download a RemoteFoo, I then create a core-data NSManagedObject...