Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / SQL

DataLoaders - Unified Data to Object Binding

Rate me:
Please Sign up or sign in to vote.
4.72/5 (35 votes)
31 Oct 2004CPOL19 min read 76.2K   2.9K   83  
A framework to completely separate objects from their data source - allowing any data source to be used without prior consideration in your code or designs. Databases, text files, web services and potentially anything else can all be used or swapped transparently.
<html dir="LTR">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>IDataItem Interface</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />
  </head>
  <body id="bodyID" class="dtBODY">
    <div id="nsbanner">
      <div id="bannerrow1">
        <table class="bannerparthead" cellspacing="0">
          <tr id="hdr">
            <td class="runninghead">DataLoader Documentation</td>
            <td class="product">
            </td>
          </tr>
        </table>
      </div>
      <div id="TitleRow">
        <h1 class="dtH1">IDataItem Interface</h1>
      </div>
    </div>
    <div id="nstext">
      <p>A wrapper around a <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDataDataSetClassTopic.htm">DataSet</a> for transporting data between a data loader and a data user.</p>
      <p>For a list of all members of this type, see <a href="Bttlxe.Data.IDataItemMembers.html">IDataItem Members</a>.</p>
      <p>
      </p>
      <div class="syntax">
        <span class="lang">[Visual�Basic]</span>
        <br />Public�Interface�IDataItem</div>
      <div class="syntax">
        <span class="lang">[C#]</span>
        <div>public�interface�IDataItem</div>
      </div>
      <h4 class="dtH4">Types that implement IDataItem</h4>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
          <tr valign="top">
            <th width="50%">Type</th>
            <th width="50%">Description</th>
          </tr>
          <tr valign="top">
            <td width="50%">
              <a href="Bttlxe.Data.DataItem.html">DataItem</a>
            </td>
            <td width="50%">
              <p>A generic implementation of the <a href="Bttlxe.Data.IDataItem.html">IDataItem</a> interface.</p>
              <seealso cref="T:Bttlxe.Data.DataItemDictionary">
              </seealso>
              <seealso cref="T:Bttlxe.Data.IDataLoader">
              </seealso>
            </td>
          </tr>
        </table>
      </div>
      <h4 class="dtH4">Remarks</h4>
      <p>Data items are objects that can represent themselves as a <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDataDataSetClassTopic.htm">DataSet</a> with optional sorting or conditional statements. A data item should not be treated as a data source as it is designed solely for the transportation of data between loaders and a data user (which may or may not be the object implementing the interface).</p>
      <p>Framework objects implementing <b>IDataItem</b> are shown in the table below:</p>
      <div class="tablediv">
        <table class="dtTABLE" cellspacing="0">
          <tr valign="top">
            <th width="50%">Object</th>
            <th width="50%">Description</th>
          </tr>
          <tr valign="top">
            <td>
              <a href="Bttlxe.Data.DataItem.html">DataItem</a>
            </td>
            <td>A generic implementation of a data item for handling custom objects.</td>
          </tr>
          <tr valign="top">
            <td>
              <b>News</b>
            </td>
            <td>A news item represents some common fields used with news releases.</td>
          </tr>
          <tr valign="top">
            <td>
              <b>NewsList</b>
            </td>
            <td>A list of <b>News</b> objects.</td>
          </tr>
        </table>
      </div>
      <p>Objects implementing <b>IDataItem</b> objects which are serialisable should either implement the <a href="Bttlxe.Data.IDataItem.Data.html">Data</a> property with the <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemNonSerializedAttributeClassTopic.htm">NonSerializedAttribute</a> or else hide its own data properties to prevent possible dupication.</p>
      <seealso cref="T:Bttlxe.Data.DataItemDictionary">
      </seealso>
      <seealso cref="T:Bttlxe.Data.IDataLoader">
      </seealso>
      <h4 class="dtH4">Example</h4>
      <p>
        <p>For an example of a data item refer to the following example which demonstrates the correct usage of a data loader and data item. (Note that the example uses the interfaces themselves to show the concept, you must substitute them for objects implementing them in your own code.)</p>
        <p class="lang">[C#]</p>
        <pre class="code">IDataLoader oLoader = new IDataLoader();
IDataItem oItem = new IDataItem();
oLoader.Execute(ref oItem, DataOperation.Read);
</pre>
      </p>
      <h4 class="dtH4">Requirements</h4>
      <p>
        <b>Namespace: </b>
        <a href="Bttlxe.Data.html">Bttlxe.Data</a>
      </p>
      <p>
        <b>Assembly: </b>Bttlxe.Data (in Bttlxe.Data.dll)
					</p>
      <h4 class="dtH4">See Also</h4>
      <p>
        <a href="Bttlxe.Data.IDataItemMembers.html">IDataItem Members</a> | <a href="Bttlxe.Data.html">Bttlxe.Data Namespace</a> | <a href="Bttlxe.Data.DataItemDictionary.html">DataItemDictionary</a> | <a href="Bttlxe.Data.IDataLoader.html">IDataLoader</a></p>
      <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
        <param name="Keyword" value="IDataItem interface, about IDataItem interface">
        </param>
      </object>
      <hr />
      <div id="footer">
        <p>
          <a href="mailto:dwulff@bttlxe.com?subject=DataLoader%20Documentation%20Documentation%20Feedback:%20IDataItem%20Interface">Send comments on this topic.</a>
        </p>
        <p>
          <a href="http://www.bttlxe.com">Copyright 2004 Battleaxe Software Ltd.</a>
        </p>
        <p>
        </p>
      </div>
    </div>
  </body>
</html>

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)


Written By
CEO Bttlxe Ltd & Incentica Ltd
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions