<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="address"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Anyone struggling with the concepts of
n-tier apps and how to put in to practice could do worse than watch the
following webcast series<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><a
href="http://www.microsoft.com/events/series/modernsoftdev.mspx">http://www.microsoft.com/events/series/modernsoftdev.mspx</a><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>while it focuses on .NET the principals
can be applied to any language/platform.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>To me it is non sensical to put business
logic/rules/objects whatever the term you want to use, in the database. One of
the major points of n-tier design is to allow change of one component of an app
without effecting the rest. What happens to your business rules if your client
decides to change to another database vendor or decides that they want to run
disconnected so you need to use XML? Which is another reason incidentally why a
lot of people are using web services in there middle tier&#8230;.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
delphi-bounces@ns3.123.co.nz [mailto:delphi-bounces@ns3.123.co.nz] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Paul A Norman<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, 7 June 2006 10:48
a.m.<br>
<b><span style='font-weight:bold'>To:</span></b> NZ Borland Developers Group - <st1:place
w:st="on">Delphi</st1:place> List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [DUG] Stored
procedures and business logic</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I'm coming in late on this thread having really valued
following&nbsp;the discussion.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Much of the difficulty in this area focusses around the simple thought
that wrong things may be attempted on the db. And that the DB should do some of
the thinking for the application. So much of the logic applied server side is
designed to sort that out. <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Is there any appeal to objective philosophical logic that points to any
overall approach that spares us the intellectual burden of having to trouble
shoot problems and&nbsp;&nbsp;that perhaps should not exist or matters that
need to be solved serverside? <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Knuth and other early logicticians propose what&nbsp;became simply
termed the &quot;rubbish in rubbish out&quot; principle. It seems that in flow
dynamics it is better to sort rubbish out before it goes &quot;down
stream&quot;, so that you avoid having to send anything &quot;up stream&quot;
calling for changes. <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Many&nbsp;people of that era&nbsp;thinking&nbsp;through this
stuff&nbsp;held the thought that each isloatible unit should have its own
integrity. Hance Knuth's <st1:State w:st="on"><st1:place w:st="on">TeX</st1:place></st1:State>
approach in page layout which is in its own way, the storage and qualifying of
data. The format of <st1:State w:st="on"><st1:place w:st="on">TeX</st1:place></st1:State>
assumes though that the 'user' has already pre-processed the actual&nbsp;data
and it is warrantable for deployment. <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>So I have been thinking alot about this stuff from the view that each
level of the process should only be passing 'data' on to the next that is in
all senses pure and appropriate. Now people will immeadiatley say that can not
work for multi-development-client applications utilising a common database. <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>To that I would make the suggestion&nbsp;of a &nbsp;server abstraction
layer which requires that an application must send a verifying &quot;key&quot;
that asserts that the post has the integrity required by the standard set for
the process. Not&nbsp;just a password alone, the purpose being to focuss the
developer to implement internally all necessary requirements prior to posting.
These requirements can available &nbsp;following the Java strategy pointed out
earlier. <o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Perhaps then logic and checks db side should only be as&nbsp;minimal as
possible -&nbsp;essential enough to ensure the basic integrity of the db is
actually maintained.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Would this&nbsp;perhaps effectively build applications which were to a
high degree abstractable from the underlying database in use?<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Paul<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>On 07/06/06, <b><span style='font-weight:bold'>Neven
MacEwan</span></b> &lt;<a href="mailto:neven@mwk.co.nz">neven@mwk.co.nz</a>&gt;
wrote:</span></font></span> <o:p></o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Kurt<br>
<br>
I have to agree with Kyley that clearly the definition of a business<br>
rule is in dispute. This reminds me that a few years ago I tried to find <br>
a definition of a 'business object' and only suceeded in finding what it<br>
wasn't, namely a row of data in a RDB. Also by your definition you could<br>
implement all business rules in the RDB, which you can't! for example a <br>
business may have well defined rules for resolving a many-to-many<br>
relationship (The most common implementation of this is an open item<br>
transaction ledger) but the best the RDB can you is enforce RI.<br>
<br>
I call the rules that protected the data DI (Data Integrity) this covers <br>
RI, Constraints, Calculated Columns (Intra Row and Aggregated) you can<br>
include State Checking (ie we cannot edit this record as it is locked).<br>
But in my experience as much as you put in the DB you cannot implement a <br>
business there IMHO<br>
<br>
Neven<br>
<br>
<br>
<br>
<br>
kurt wrote:<br>
&gt; Neven MacEwan wrote:<br>
&gt;&gt; All the constraint/ri ui code can a) be extracted out of the DB or b)<br>
&gt;&gt; be autogenerated from metadata <br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&gt; Where does referential integrity end and business
logic begin anyway?<br>
&gt;<br>
&gt;&nbsp;&nbsp;- a database is a collection of constraints<br>
&gt;&nbsp;&nbsp;- a business rule is a constraint<br>
&gt;<br>
&gt;&gt; firstly I make the distinction in the respect that a change in <br>
&gt;&gt; business rules should not alter your ri, the difference is breaking ri<br>
&gt;&gt; would result in &quot;what the sh#t is this&quot;, breaking business
rules<br>
&gt;&gt; results in &quot;should we be allowing this sh#t&quot; <br>
&gt;<br>
&gt;<br>
&gt; I don't see the difference : referential integrity is one<br>
&gt; (the most common) way of implementing business rules.<br>
&gt;<br>
&gt; &quot;unique index on client ID&quot; is a simple RI statement, <br>
&gt; that enforces the rule that client ID's are unique within<br>
&gt; that set of data, no?<br>
&gt;<br>
&gt;<br>
&gt;&gt; Its basically the same mismatch that exists between an OO system and a<br>
&gt;&gt; Relational Database, it all goes away if you accept/assume that a row <br>
&gt;&gt; of a table is a class instance persisted, the question is should you?<br>
&gt;<br>
&gt; Nope. Class = Type ;)<br>
&gt;<br>
&gt;<br>
&gt; Cheers, Kurt.<br>
&gt; _______________________________________________<br>
&gt; <st1:place w:st="on">Delphi</st1:place> mailing list <br>
&gt; <a href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a><br>
&gt; <a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>
&gt;<br>
&gt;<br>
<br>
--<br>
Neven MacEwan ( B.E. E&amp;E)<br>
Ph. 09 620 1356 Mob. 027 4749 062<br>
<br>
New Address Details<br>
===================<br>
MWK Computer Systems<br>
<st1:Street w:st="on"><st1:address w:st="on">1 Taumata Rd</st1:address></st1:Street><br>
<st1:place w:st="on">Sandringham</st1:place><br>
<st1:City w:st="on"><st1:place w:st="on">Auckland</st1:place></st1:City><br>
<br>
Ph 620 1356<br>
Fx 620 1336<br>
<br>
<br>
_______________________________________________ <br>
<st1:place w:st="on">Delphi</st1:place> mailing list<br>
<a href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a><br>
<a href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a><br>
<br>
<br>
<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>