SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Where Logic Lives


Where Logic Lives

Author
Message
Adam Machanic
Adam Machanic
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1549 Visits: 714
Peter,

You going to be at PASS? We clearly need to have a beer

--
Adam Machanic
SQL Server MVP
SQLblog.com: THE SQL Server Blog Spot on the Web
Peter Kryszak
Peter Kryszak
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1346 Visits: 3
I would enjoy that. However, I won't be there. My current contract has me too busy, but being active in this conversation has been worth while .

Your post just beat mine in, but we are thinking alike on this.



sushila
sushila
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3499 Visits: 639
well - I'm not going to PASS so i think I'll just have mine right away...
I know you're going to be one of the speakers Adam...shame I'm going to miss that and all the other names I know so well from this site and otherwise as SQL gurus!

Peter...everytime you feel a diatribe coming on...you should take deep breaths and count to 10 - 100 - whatever it takes...unless you're attending PASS and are patient enough to wait for the promised beer!







**ASCII stupid question, get a stupid ANSI !!!**
Adam Machanic
Adam Machanic
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1549 Visits: 714
One of the main points of my talk is to implement encapsulation and think of stored procedures as black-box APIs

--
Adam Machanic
SQL Server MVP
SQLblog.com: THE SQL Server Blog Spot on the Web
sushila
sushila
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3499 Visits: 639
well - talk about coincidences......that alone calls for a beer!







**ASCII stupid question, get a stupid ANSI !!!**
Adam Machanic
Adam Machanic
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1549 Visits: 714
Agreed... I think I'll go have some now. We have our Boston-area "geek dinner" tonight

http://nerddinner.com/blogs/boston/archive/2005/08/17/6816.aspx

--
Adam Machanic
SQL Server MVP
SQLblog.com: THE SQL Server Blog Spot on the Web
Mike Dillon
Mike Dillon
SSC Rookie
SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)SSC Rookie (38 reputation)

Group: General Forum Members
Points: 38 Visits: 38

Adam,

I think we are going to have to agree to disagree. Your example in no way represents business logic. That is simply a data rule. Again, I urge you to check your definition of business logic. As for Peter's trust issue, of course there are constraints on the table, there is referential integrity built into the design of the DB, but that isn't business logic. Think of it this way, business logic is decided by the business and is subject to change. Margin trading isn't decided by company ABC, it is decided by a set of rules that superceede that business. The logic that decides if trader A is qualified for a margin account is business logic and once that is decided then your data validation rule comes into play.

It would really help me if you could give me a real world example of something you have done that speaks to this issue.

Also, I am truely hurt that I wasn't invited to the beer discussion at PASS.


David Webb-CDS
David Webb-CDS
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1558 Visits: 8586

Hmmm, getting around the semantics of 'business logic', 'application logic', and 'data validation', I'd like to propose that any logic, the avoidance of which may produce rows in the database which do not reflect true propositions, belongs inside the DBMS and should be a function for the DBMS to enforce.





And then again, I might be wrong ...
David Webb
Adam Machanic
Adam Machanic
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1549 Visits: 714
Mike,

No one said that the logic to determine whether or not the trader was qualified for a margin account wouldn't also be represented in the database. As a matter of fact, it probably should be! Otherwise, can you guarantee that the application made the right choice?

The beer, alas, was supposed to be a quaff in the name of agreement, not debate

--
Adam Machanic
SQL Server MVP
SQLblog.com: THE SQL Server Blog Spot on the Web
noeld
noeld
SSCrazy Eights
SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)

Group: General Forum Members
Points: 9528 Visits: 2048

I would like to add a bit more of clarity to what I said before:

The minute you declare a Column data type you are using BUSSINESS RULES

The minute you use CHECK Constraints or ANY kind of constraints you are applaying BUSSINESS RULES

The minute you specify LOGIC ORDER of operations in your stored procedures you are using BUSSINESS RULES

I am not asking to to program a Maximun of Pontryagin algorithm or Ruffini's root detection algorithm for 1000th root. Just what is best to establish in the database should be there and what is best to write in the middle tier should be there!

The SET based approach to apply certain calculations on the middle tear should be avoided if possible can you think of a 20 Million records going back and forth between severs!? If it is possible to apply those rules on a database I would! then again sometimes is not and I have nothing againts that!

IT is in my opinion not a clear cut!

IF you want maximum flexibility would you make all your columns varchar(8000) and that way you can handle every value and variation in length and data type?

We don't need to go to extremes and we should take care as much as we can of data quality and as close as possible to the data!!

Just my $0.02 or should I said my £0.02 (I am in London today )

Beer!!!




* Noel
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search