Separation Anxiety
secretGeek .:dot Nuts about dot Net:.
home .: about .: sign up .: sitemap .: secretGeek RSS

Separation Anxiety

(Okay this won't necessarily make any sense.

I've been thinking about three different but similar concepts.

They're all based on this template:

Separate your $x from your $y: how why and why not?

where $x and $y could be:

  • content and presentation
  • database and business rules
  • code and data

Let's start at the end: code and data. How are they separated?

First consider those three famous security holes: "buffer overflow, sql injection and cross site scripting (i.e. xss.) They're all caused by exploiting the blurry line between data and code.

So it's easy to jump to the conclusion that a blurry line between data and code is dangerous... we're only safe if we keep our data and our code separate.

But this is powerful magic: mingling code with data is powerful stuff! yes, it must be handled with care, but it must be handled.

Lisp is generally said to blur the line between data and code, because you can't interchange one into the other so easily. <rolls eyes... he's mentioning lisp again... here we go> chill winston! it will be okay!. But I don't see where this makes lisp so special. The whole von neumann processor architecture, is based on reading instructions and data from the same place.

Oh, here's a quote from Paul Snively that says it well:

So this incessant harping on data-as-code and code-as-data in Lisp merely obscures the fact that data is code and code is data in computing. That's the lesson of Lisp, but unfortunately it's gotten lost in the Lisp dogma.

This reminds me of something I heard at uni, and haven't thought about until now: There were apparently some early processor architectures in which data and instructions were kept in separate memory units. The 'instruction pointer' would be up to one place in the instruction memory, and the 'data pointer' would be up to a different place in the data memory. (Ah! It's called the Harvard Architecture, tanks agen, wikipedia)

This model died, and von neumann architecture won out. So, tody we have "instructions and data" in the same place, interchangeable and ultimately it's anybody's guess what makes for data and what makes for code.

You might say that code is 'whatever gets executed.' But, if code isn't yet executed it's still code, not just data. And just because code has been executed doesn't mean it stops being data. So I don't think there's a distinction between them at low levels. At higher levels, there can appear to be a distinction, but at the highest levels, the distinctions dissappear again, lisp etc. Anyway, I'm lost in this paragraph: i'll move on to the next biot: the separation of business rules from everything else.

Keep your business rules in your business rules layer.

This is pretty much accepted dogma in the n-tier custom software world where I live. But it's impossible to enforce absolutely.

What exactly is a business rule? How and when does it differ from everything else in the solution?

i like this quote from wikipedia:

"There exists no definition of business logic in any programming language specification or API, nor in any academic research. However, usage of the term persists in trade publications..."

but be careful -- if you stop believing in the existence of 'business rules' you might vomit up the kool aid -- spit out the red pill, and do a Gunderloy ;-).

So what am i saying? have i become a business rules atheist?

Never -- i've just started to realise that there's some business rules that live in the presentation layer. There are some business rules that live in the database. And there are some things that aren't business rules that live in the business layer. It's all fluid, like Thermodynamics, baby

<[?Pragmattism: that's the ticket!. Given a particular fact in our system, what is the likelihood of it changing: based on our own experience? and where can we place this fact so that it fulfills some optimum combination of:
  • cheap to change,
  • not repeated,
  • easy to use,
  • available when needed

Much to say -- but no motivation to share it (right now).

The final topic is separation of content and presentation... but right now the brain is overloaded. Discuss quietly amongst yourselves. Teacher has a headache.





'Scott' on Fri, 29 Jun 2007 13:03:23 GMT, sez:

Don't forget to separate your software from your users. After that, everything is easy.



'Ryan Smith' on Fri, 29 Jun 2007 15:49:28 GMT, sez:

"Vomit up the kool aid and do a Gunderloy"
Classic.



'Matt Blodgett' on Fri, 29 Jun 2007 16:49:02 GMT, sez:

The Gunderloy reference was perfect.



'lb' on Sun, 01 Jul 2007 08:59:08 GMT, sez:

@Matt/Ryan
"The Gunderloy reference was perfect."

No, it's an unfair mischaracterisation. I never liked that bit, and i almost cut it out. I left it in cause it's funny, but it's definitely a little bit wrong. ;-)

thanks though!



'Doekman' on Sun, 01 Jul 2007 14:47:16 GMT, sez:

Harvard Architecture ain't dead:
http://en.wikipedia.org/wiki/8051

OK, it's not very much alive, but the 8051 derivates are still in use.



'Chui' on Wed, 04 Jul 2007 08:07:17 GMT, sez:

Insofar as code and data are concerned, we can delve into mysticism and see that verbs have no meaning on it's own, and only has meaning if nouns exist.

Therefore, code and data are merely mental constructs for something that's inherently One.

Similarly the distinction between business and presentation layer starts to get blurred when data entry with validation occur. The business layer cannot work without cooperation of the presentation layer. Taken to singularity, the presentation becomes a representation of a business layer, so instead of MVC, we have Model-Representation architecture.



'Joe Reddy' on Wed, 02 Apr 2008 17:12:35 GMT, sez:

"i've just started to realise that there's some business rules that live in the presentation layer. There are some business rules that live in the database. And there are some things that aren't business rules that live in the business layer."

Do you still believe this?




name


website (optional)


enter the word:
 

comment (HTML not allowed)


All viewpoints welcome. But the right to delete any post for any reason is reserved. Don't make me do it. Aim for constructiveness. Comments may be republished, emailed to your loved ones or printed and used as toilet paper. Also, I get particularly nasty on comment spam. It's not worth even trying to post comment spam here -- your html is escaped, and your links are given a rel='nofollow'. By attempting to post a comment, you understand that if the comment is considered spam, at my absolute discretion, your IP address may be used as the target of a prolonged distributed denial of service attack. Your electricity might suddenly stop working. Your car tyres will go mysteriously flat. You will suffer permanent hairloss. Your dreams will be filled with terrifying monsters. And in any case I reserve the right to record and publish your IP address.

 

TimeSnapper is a life analysis system that stores and plays-back your computer use. It makes timesheet recording a breeze, helps you recover lost work and shows you how to sharpen your act.

 

NimbleText - FREE text manipulation and data extraction

NimbleText is a Powerful FREE Tool

Use it for:

  • extracting data from text
  • manipulating text
  • generating code

It makes you look awesome. Use it right now! Go on! Hurry! Don't walk, run!

 

Articles

Mind-boggling Demo of New Gaming Genre, aka Folder-Based Hangman, aka Fun with Recursion Mind-boggling Demo of New Gaming Genre, aka Folder-Based Hangman, aka Fun with Recursion
Got CSV in your javascript? Use agnes. Got CSV in your javascript? Use agnes.
I went to write down a book name and founded an internet empire instead. I went to write down a book name and founded an internet empire instead.
NimbleText: Origins NimbleText: Origins
The Windows 8 Mullet The Windows 8 Mullet
Cosby: spontaneous striped background generator Cosby: spontaneous striped background generator
Slides from WDCNZ: Live Coding Asp.net MVC3 Slides from WDCNZ: Live Coding Asp.net MVC3
MVC 3, MVC 3, "Third Times a Charm" references
Custom Errors in ASP.Net MVC: It couldn't be simpler, right? Custom Errors in ASP.Net MVC: It couldn't be simpler, right?
Anatomy of a Domain Hijacking, part 2: The Website Who Came In From The Cold Anatomy of a Domain Hijacking, part 2: The Website Who Came In From The Cold
Anatomy of a Domain Hijacking, part 1 Anatomy of a Domain Hijacking, part 1
secretGeek.net domain has been stolen. The site may go down. secretGeek.net domain has been stolen. The site may go down.
Boring article: 'untrusted domain' issue with SQL Server. Boring article: 'untrusted domain' issue with SQL Server.
Coding While You Commute Coding While You Commute
Test Driven Dentistry Is A Good Thing Test Driven Dentistry Is A Good Thing
The 'less crashy' release of NimbleText The 'less crashy' release of NimbleText
Rethinking Toolbars in Visual Studio (or any IDE) Rethinking Toolbars in Visual Studio (or any IDE)
Where shall we have lunch? Where shall we have lunch?
Setting up email for your microIsv Setting up email for your microIsv
The NO Visual Studio movement: Compiling .net projects in Notepad++ The NO Visual Studio movement: Compiling .net projects in Notepad++
ZeroOne: the editor for programmers who think in binary ZeroOne: the editor for programmers who think in binary
Mercurial workflow for personal projects (with a .net bias) Mercurial workflow for personal projects (with a .net bias)
I see you're using vim. Let me fix that for you. I see you're using vim. Let me fix that for you.
The worst recruitment spam I've ever read The worst recruitment spam I've ever read
A thank you I forgot to say A thank you I forgot to say
My new product, NimbleText, is live My new product, NimbleText, is live
Grabbing the free songs of Jonathan Coulton (with Powershell) Grabbing the free songs of Jonathan Coulton (with Powershell)
Using NimbleSet to compare lists Using NimbleSet to compare lists
Wanted: Wiki Lists (dot org) Wanted: Wiki Lists (dot org)
DOS on Dope: The last MVC web framework you'll ever need DOS on Dope: The last MVC web framework you'll ever need
JSON Query Languages: 5 special purpose editors JSON Query Languages: 5 special purpose editors
What then, is b? What then, is b?
SQLike: A simple editor SQLike: A simple editor
Yet Another BizPlan Generator. Yet Another BizPlan Generator.
HOT GUIDS: A hot or not site for guids HOT GUIDS: A hot or not site for guids
How does life get better? One tiny hack at a time. How does life get better? One tiny hack at a time.
24 things to do, and 100 things *not* to do (yet) for building a MicroISV 24 things to do, and 100 things *not* to do (yet) for building a MicroISV
Venture capital won't kill Jeff Atwood, it will only make him Jeffer. Venture capital won't kill Jeff Atwood, it will only make him Jeffer.
A handy workflow image for newbie mercurial users A handy workflow image for newbie mercurial users
Fractal Feedback, a diversion into recreational programming Fractal Feedback, a diversion into recreational programming
Hump-Jumping: How the Education of Computer Science can be Saved, err, maybe. Hump-Jumping: How the Education of Computer Science can be Saved, err, maybe.
Suggested User Experience Improvements for DiffMerge Suggested User Experience Improvements for DiffMerge
SQL Style Extensions for C# SQL Style Extensions for C#
The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's The Movie Hollywood (And My Wife) Doesn't Want You To See: Weekend at Jacko's
Sysi: the ultimate administrators toolkit Sysi: the ultimate administrators toolkit

Archives .: secretGeek :: Complete Archives
TimeSnapper -- Automated Screenshot Journal TimeSnapper.com    
Version 3.3: true productivity boost

Next Action NextAction
Managing the top of your mind

NimbleText -- World's Simplest Code GeneratorNimbleText -- World's Simplest Code Generator, Text Manipulator, Data Extractor

25 steps for building a Micro-ISV 25 steps for building a Micro-ISV
3 minute guides -- babysteps in new technologies: powershell, JSON, watir, F# 3 Minute Guide Series
Universal Troubleshooting checklist Universal Troubleshooting Checklist
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Realtime CSS Editor, in a browser RealTime Online CSS Editor
Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker


[powered by Google] 


How to be depressed How to be depressed
You are not inadequate.



Recommended Reading


the little schemer


The Best Software Writing I
The Business Of Software (Eric Sink)

Recommended blogs

Jeff Atwood
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
Thomas White
OJ Reeves
Eric Sink

Aggregated Links

proggit
dzone
hacker news
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
weekly link post

LinkedIn profile
LogEnvy - event logs made sexy
Computer, Unlocked. A rapid computer customization resource
PC Smart Buys - Computer Hardware in Australia
 
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2006 .: privacy

home .: about .: sign up .: sitemap .: RSS .: © Leon Bambrick 2006 .: privacy