abstraction

Define Implementation for abstract Object

I am looking for a way to do the following: A Project : Defines an abstract class that is called when some events happen (event handler if you will) Defines the engine that will fire the events using the event handler above B Project: Defines the implementation for the abstract class Runs the engine. How can i register the implementa...

Java extension/abstraction/implementation question.

I have three classes (class A, class B, and class C). Class A calls an instance of B and runs start(). Class B extends Thread, so when start() is called, anything in the run() method is executed. In the run() thread, there is an instance of class C. Is there anyway to allow a method in Class C to call a method in Class A, without ins...

Information Hiding vs. Hidden Dependencies

Dear StackOverflow, What are some common best practices in procedure (or function, module, etc.) design for balancing the desire for information hiding and an appropriate level of abstraction in the procedure's interface with the problems inherent in introducing hidding dependencies? To be more concrete, suppose I code a procedure call...

C# Custom Object Validation Design

I currently have to validate custom Field Objects for my application. Simply put, each Field object consists of information about the validation for the field, as well as the value of the field. I am validating fields in bulk, so currently, I have a validation class, that has a method for each validation. For required fields, it looks so...

Abstraction and client/server architecture questions for Python game program

Here is where I am at presently. I am designing a card game with the aim of utilizing major components for future work. The part that is hanging me up is creating a layer of abstraction between the server and the client(s). A server is started, and then one or more clients can connect (locally or remotely). I am designing a thick client ...

Abstracting .NET logging with Common Infrastructure Libraries:

Hi, I've recently been considering abstracting my logging across the application. A more specific post on another resource led to the recommendation of the "Common Infrastructure Libraries": http://netcommon.sourceforge.net/ Specifically, the Common.Logging class, which provides a common interface which can sit in front of a number o...

How do I go about abstracting URLs?

URL abstraction: www.domain.com/perl.pl to www.domain.com/perl I am reading MIT's Software Engineering for Internet Applications (specifically, http://philip.greenspun.com/seia/basics ) and the author, Philip Greenspun, mentions URL abstraction but doesn't seem to go into any of the details of actually implementing it. I'm running Debi...

Generic return types from abstract/virtual methods.

I have a relationship between two base classes: public abstract class RecruiterBase<T> { // Properties declare here // Constructors declared here public abstract IQueryable<T> GetCandidates(); } public abstract class CandidateBase<T> { // Properties declare here // Constructors declared here } And their concrete implementa...

How to share code between model and controller in Rails?

Both my Rails model and controller code need to write files to the file system. I would like to consolidate the logic into one method. What's the best way to share this method across models and controllers? Thanks! ...

Providing common functionality for aggregates derived from the same base object using the Repository Pattern

I'm attempting to use the Repository Pattern to write a data access layer on an existing DB2 schema. This schema has several aggregates all having a common base entity of a "Document." When building the business objects, I created the Document entity as an abstract, and the aggregates as entities derived from Document. For example: p...

Is the concept of abstraction relevant to tables in MySQL? If so, how can I do it?

I want to store data on various engines in a MySQL database, which includes both piston and rotary engines. In OO languages, I can create and extend an Engine superclass to obtain PistonEngine and RotaryEngine subclasses. The PistonEngine subclass would contain properties such as CylinderNo, PistonBore and PistonStroke. The RotaryEn...

Alternate name for BackingStoreException

I'm about to undertake the task of abstracting out all SQLExceptions from an ORM's public interfaces with something more generic - that is declaring a generic exception which would in most cases wrap say an SQLException), and I'm wondering about naming. I'm thinking of something along the lines of BackingStoreException or StorageMediumE...

Writing a JavaScript abstraction abstraction - is this sane?

I've written a JavaScript application that runs off Prototype & Scriptaculous. I'm thinking of rolling it out in as an open source product & would like it to be able to run on jQuery as well — I typically use jQuery for most of my other apps, except the site this app was originally built for. I was originally thinking about building two...

Abstracting Sorted Values as Key-Value

I am writing an interface to a sorted collection of objects. As is the usual, I leave it up to the user to specify how these items are sorted. I am currently torn however, between offering a key-value interface (where the sort key is explicitly separate from the value) or a value-only interface (where the value is either also the sort ke...

How does an environment (e.g. Ruby) handle massive integers?

My integers in Ruby (MRI) refuse to overflow. I've noticed the class change from fixnum to bignum but I'm wondering how this is modeled and what sort of process ruby uses to perform arithmetic on these massive integers. I've seen this behaviour in SCHEME as well as other environments. I ask because I'd like to implement something simil...

Should a service be given a reference to another, or should the caller gain extra responsibility?

There are two classes in my project (using ASP.NET MVC): AuthenticationService, and ProfileService. When a new user registers at my site the Authentication controller's Register action calls a Register method in IAuthenticationService, which creates an authentication record for the user according to whichever concrete authentication modu...

shared functionality between C# console apps

I have two console apps, Query and Update, that share some functionality. I wanted to have the two classes inherit from a common base class, but the problem is that, for a console app, I have to have a static Main function. What I currently have is the following: namespace Utils { public class ConsoleBase { protected c...

How to differ abstraction form a software component

How can we clearly differ architectural term abstraction from a software component, can abstraction lie within a software component? ...

SQL query generator for Perl with stored procedures support

Current code base I'm working on is full of ad-hoc conditional string concatenations producing less than clear SQL queries. I want to make them maintainable, but since using DBIx::Class is too complex to move to for now (giant legacy base), I'm looking to at least make them more robust by using some sort of SQL generator, which would onl...

Designing an OS abstraction layer

While Developing an OS Abstraction layer for a multi-modular system, which approach should one take: Create a Shared Library of OS services and each module is built to use it and runs as individual processes. OR Create only a single instance of abstraction layer which provides memory, timer services and which alone spawns all in...