Re: Declarative Data Access
From: David Browne (meat_at_hotmail.com)
Date: 11/05/04
- Next message: Mary Chipman: "Re: A severe error occurred on the current command"
- Previous message: David Browne: "Re: ADO.NET and ODBC { CALL ..... } Syntax"
- In reply to: Angelos Karantzalis: "Declarative Data Access"
- Next in thread: Alvin Bruney [MVP]: "Re: Declarative Data Access"
- Reply: Alvin Bruney [MVP]: "Re: Declarative Data Access"
- Reply: Angelos Karantzalis: "Re: Declarative Data Access"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Nov 2004 13:50:01 -0600
"Angelos Karantzalis" <akarantzalis@yahoo.com> wrote in message
news:enUDeq2wEHA.1976@TK2MSFTNGP09.phx.gbl...
> 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 ... });
The XML is a good first step, but I wouldn't use it at runtime. Build a
small program which will read the XML file and output a source code file
which executes these procedures and compile that file into your project.
Then in your code you could call the procedure like this:
DataSet results = dal.AddIncident("testname",null,null,4,...);
You get the best of both worlds, plus you get typesafe binding of your
application code to your database interface, so if you pass a string where
you should pass an int, the compiler will complain.
David
- Next message: Mary Chipman: "Re: A severe error occurred on the current command"
- Previous message: David Browne: "Re: ADO.NET and ODBC { CALL ..... } Syntax"
- In reply to: Angelos Karantzalis: "Declarative Data Access"
- Next in thread: Alvin Bruney [MVP]: "Re: Declarative Data Access"
- Reply: Alvin Bruney [MVP]: "Re: Declarative Data Access"
- Reply: Angelos Karantzalis: "Re: Declarative Data Access"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|