Layering Apps

by volkanuzun 8/28/2008 5:03:00 PM

I am sure you've heard a lot about layering your application for scalability, maintanence or testing purposes. How do you know you have layered it enough? If you have a ui layer (presentation layer), a database access layer and a business layer, can you say you have 3 tier application?

I am refactoring my old codes, and most of the time i am ashamed of myself having those ugly code no matter what my excuse was (mostly it is either lack of time, or learning curve of new technology). So back to the topic, when you have a class library for db access, a class library business logic, and ui app (either a web app, or desktop app etc), are you 3 layered? By looking my old code, i can answer for myself; NO.

I kinda developed some checkpoints for myself to prove if i am even close enough to writing 3-tier apps. One of the questions in the list is, if my ui is accessing a database, and if by keeping the schema same, i want to switch to an xml file or another database, would i change any code in my ui ? If yes, then still my ui is tightly depending on the database itself more than the domain. Same question applies to business layer, if i change the data souce to an xml file, would it still work without cde changes?

I recently start studying LINQ, so i try to refactor code benefitting linq, but then the same question came to my mind? how will i make 3-tier app with linq? i decided spend more time on this, and i will share my experience about this study here on my blog.  I am going to write a very simple web app using vertigo's coho winery database. I will first start doing 1 tier app :), adding layers as i iterate to new versions, and also refactoring some of code, as i study linq more :)

the database diagram for the application is below:

 


so my next posting will have a simple asp.net page listing info about wines in a gridview

Tags:

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



About the author

Volkan Uzun




E-mail me Send mail

Twitter

Calendar

<<  December 2008  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Flickr Badge

www.flickr.com
This is a Flickr badge showing public photos from volkanuzun. Make your own badge here.

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in