Declarative Data Access

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Angelos Karantzalis (akarantzalis_at_yahoo.com)
Date: 11/05/04


Date: Fri, 5 Nov 2004 21:04:04 +0200

Hi guys,

for a while now, we've been flirting with the idea of having a single
component in our app that handles all the plumbing for our Db calls (
creating connections, Commands & Parametes etc. ) through an xml definition
of each Db call.

For instance, a call to a Stored Procedure would be described like this:

<data-action id="AddIncident" type="1" data-source="local"
query="sp_AddIncident" cached="false"
cache-timeout="0" sql-type="0">
<params>
<param name="@Name" type="String" required="true" />
<param name="@Descr" type="String" required="false" />
<param name="@StatusID" type="Int64" required="false" />
<param name="@TypeID" type="Int64" required="false" />
<param name="@DtOccured" type="DateTime" required="false" />
<param name="@DtReported" type="DateTime" required="false" />
<param name="@ReportedBy" type="String" required="false" />
<param name="@Place" type="String" required="false" />
<param name="@Cause" type="String" required="false" />
<param name="@OrganizationID" type="Int64" required="false" />
<param name="@Notes" type="String" required="false" />
<param name="@SysUser" type="String" required="false" />
</params>
</data-action>

.. and you could use the component in manner like:

DataSet results = DataActionManager.execute("AddIncident", new
object[]{"testname", null, null, 4 ... });

That will certainly cut down on our development time, as well as provide for
some separation of our DB interface from it's actual implementation (e.g. we
could define our db operations, give them a name & then the C# developer &
the db developer could work almost independently, plus we could change data
sources transparently, cache the results etc. etc.).

However, we're concerned with memory usage. A 200K xml file containing 100
db call definitions would have to stay in-memory because it wouldn't make
sence to load/parse it on every call to the component. Isn't that a
significant overhead ?

Our "solution" is to deserialize the xml into objects - that will probably
cut down on memory, but how much we've no idea :?

Our other concern is .. is it worth it ? From a re-usability point of view
and developer-friendlyness i feel it would be very much worth the time, and
the performance/speed trade-off between using the component or straight
ADO.NET code i guess is minimal ... plus I like the idea of having
performance-critical code in one place where we can work on optimizations
and code efficiency rather than leave it up to every junior developer to
handle the db coding.

What it all boils down to is: Although we think it's a good idea, does
anybody out there agree or disagree ? Could you see some potential problems
or reasons that we shouldn't use something like that ?

Cheers,
Angel
O:]



Relevant Pages

  • Re: Adobe Flex for MV GUI
    ... I really don't like the trend toward using XML in-line with code to ... as long as its readable and the developer has access to tweak ... free/open-source Ajax Control Toolkit which most ASP.NET ... Your HyperFlex control could easily be a common addon for any Flex ...
    (comp.databases.pick)
  • Re: Test Driven Development and C#
    ... programmer comes along and needs to edit what I wrote and breaks my ... as the unit tests are broken and politely ask the developer responsible ... How does one go about Unit Testing data structures like XML that are ... validate if it's well-formed XML. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finding references
    ... write an XSLT document to translate the XML back into a format that can ... ask any developer and they'll tell you that they need this data in a FM ... The DDR file that FM 5 or 5.5 ...
    (comp.databases.filemaker)
  • Declerative Data Access
    ... the db developer could work almost independently, ... A 200K xml file containing 100 ... is it worth it? ... the performance/speed trade-off between using the component or straight ...
    (microsoft.public.dotnet.general)
  • Re: Excel 2007 Menus - Ron De Bruin please
    ... Ron / Bob / Jim, ... then have to add buttons to the custom group and have the following ... using XML script / callbacksto generate buttons / dropdowns within ... required by the developer who will need to learn XML if they are not ...
    (microsoft.public.excel.programming)