Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » Data Access » Downloads
 
Add your own
alternative version

Abstract Data Access Layer Design

, 5 Sep 2009 CPOL
The present document tries to describe the architecture of a specific layer of access to data for relational databases. This document tries to present/display a form to automate tasks of access to data.
demoproject.zip
DemoProject
Test
(ClassDiagram1).cd
bin
Debug
Test.exe
Test.vshost.exe
Test.vshost.exe.manifest
XPeriment.Persistence.dll
Properties
Settings.settings
Test.csproj.user
XPeriment.Architect
bin
Debug
BizAgi.Architect.vshost.exe
BizAgi.Architect.vshost.exe.manifest
Experiment.Architect.exe
Experiment.Architect.vshost.exe
Experiment.Architect.vshost.exe.manifest
Properties
Settings.settings
XPeriment.Management.suo
XPeriment.Persistence
(ClassDiagram).cd
bin
Debug
XPeriment.Persistence.dll
DataAcessTasks
(ClassDiagram).cd
(ClassDiagram1).cd
SqlServer
PersistentObjects
(ClassDiagram).cd
Attributes
Properties
Settings.settings
XPeriment.Persistence.csproj.user
using System;
using System.Collections.Generic;
using System.Text;
using XPeriment.Persistence.Properties;
using System.Runtime.Remoting;

namespace XPeriment.DataAccessTasks
{
    public class BaseTask
    {
        private static DataTaskPerformer loadedperformer = null;
        private PerformerTransaction currenttransaction = null;

        public PerformerTransaction CurrentTransaction
        {
            get
            {
                return currenttransaction;
            }
            set
            {
                currenttransaction = value;
            }
        }

        private string basetable = "";

        public DataTaskPerformer Performer
        {
            get
            {
                return GetDefaultPerformer();
            }
        }

        public string BaseTable
        {
            get
            {
                return basetable;
            }
            set
            {
                basetable = value;
            }
        }

        public BaseTask(string baseTable)
        {
            basetable = baseTable;
        }

        private DataTaskPerformer GetDefaultPerformer()
        {
            if (loadedperformer != null)
                return loadedperformer;
            ObjectHandle objhndl = Activator.CreateInstance(Settings.Default.ProviderAssembly, Settings.Default.ProviderClass);
            object performer = objhndl.Unwrap();
            if (performer == null)
                throw new Exception("Assembly not found!");
            else if (!(performer is DataTaskPerformer))
                throw new Exception("Data type on setting file is not a data task performer");
            else
            {
                
                loadedperformer = (DataTaskPerformer)performer;
                return loadedperformer;
            }
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anwar Ibáñez O'Kamell
Systems Engineer
Colombia Colombia
http://www.construirsoftware.blogspot.com/

| Advertise | Privacy | Mobile
Web03 | 2.8.141022.2 | Last Updated 5 Sep 2009
Article Copyright 2009 by Anwar Ibáñez O'Kamell
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid