Giter VIP home page Giter VIP logo

datalank's Introduction

DataLank

What is it?

DataLank is the lightest possible abstract layer to access data. It is so light it is not complete. It is not ORM. It is not an be-all-end-all solution. It is not a data link. It provides a singular way to fetch and forward-only iterate single simple query result sets. Want more? Look elsewhere. The point of using a few objects with a pre-described interface is to avoid some of the work of switching to a different database somewhere down along the lifetime of a project, but not all.

How does it work?

DataLankProtocol.pas defines the interface for the TDataConnection and TQueryResult and objects, but you're not supposed to use it. (Except perhaps to include it in a project to see wether it compiles without syntax errors.)

In your project, include a DataLank.pas unit that just contains code like this, patching the objects through to the implementation of your choosing:

unit DataLink;

interface

uses SomeDBData;

type
  TDataConnection = TSomeDBConnection;
  TQueryResult = TSomeDBCommand;

implementation

end.

This enables you to use TDataConnection in the initialization code and TQueryResult throughout the application, and still change to a different database solition at a later point in the project's lifetime.

Implementations

Why 'Data Lank'

It's not quite a data link. The point is to have a data-layer that is as thin as possible, so I selected something from m-w: thesaurus/thin and as noted by m-w: dictionary/lank 'lank' stands for:

  • not well filled out: not every operation on the database is available in the limited abstraction. Normal operation can use the TQueryResult object, but advanced work like iterating over the results in a different manner or initiating an automated backup had to be done by talking to the specific database interface or other tools.

  • insufficient in quality, degree or extent: it is not suitable to everyone or for any project. Select to use DataLank in projects that will primarily use data from the database in a straight-forward manner, and can divert to other means to perform any advanced work on the data.

  • hanging straight and limp without spring or curl: it just lets you get and use data from the database using TQueryResult, nothing much more. It doesn't do any extra work for you. It's not ORM. It's only a clean simple imperfect abstraction layer to deminish the work needed to switch to a different database at a later point in the project's lifetime, but specifically not to eleminate that effort.

Examples of things made with DataLank

datalank's People

Contributors

stijnsanders avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.