Friday, March 13, 2009

Buiding N-Tier VS NON N-Tier Applications

There different ways to do things, I don’t expect a programmer before me to do things the way I do them or the programmer after me to do the things the way I do them. But I believe companies should enforce a law on the approach of application development. If programmers were arrested for doing certain things in an application, I think a lot would have been arrested and that includes me.

I came to learn from my first article i wrote for codeproject . That application should be tired. No matter how small the application can be they should be tired. I came across applications that were poorly tired, at least they tried and I can across the applications that were not tired at all. Coming from an n-tier background has become worse part of my career finding that an enterprise application has not been tired. In some instances you will find form with sql inside, in others you will find pages with sql inside them. Microsoft has made programmers of today more productive and programmers abused their powers, today data layers are not created anymore, not to mention business logic layer. People write code that is a victim to sql injection . I have just enjoyed the benefits of writing applications in an n-tier style.

ü It’s easy to maintain the application. If there is an exception, you know which part to check.
ü It has resilience to change, if a new functionality is requested, you will not touch other part of the code, you will just add in 3 places your DAL (Data Access Layer) àBLL (Business Logic Layer) àPL (Presentation Layer).
ü Your layer can be access by any type of Client WEB ,Windows or Mobile
ü A Programmer After you will follow the same Rules and he will understand the System very easily.
ü The SQL side is done only on the SQL server and the StoredProcedure are called from one layer (DAL).
ü Errors are handled in one place, which mean in a DAL errors are not handled, but instead they are passed to the calling function or method.
ü Business Rules are not handled in the Pages or Forms; they are handled in the BLL layer.


Microsoft has done a very good job on its technologies like ado.net and more… When Linq was introduced, it did not fit into my plans; I kept my sql in the Server and continued to call my sp’s from the data access layer. Now Linq to dying see below links

http://ayende.com/Blog/archive/2008/10/31/microsoft-kills-linq-to-sql.aspx

http://quintesvanaswegen.com/2009/01/15/on-net-microsoft-kills-linq-to-sql/

, I don’t know what is going to happen to those who implemented it. This proved that it is not a good idea to write your sql with your C# or vb.net code. In this Blog I welcome critics and good comments. Tell me what you think about this subject.

Thank you,



I recently inherited a Project that was stored in Visual Source Safe, i made a copy of the Project to my local machine and tried to work on it, and when i open my main project from the VSS, i found that the changes reflected on themain project. That was a Dangerous thing to have. So i decided to find the way to remove the binding from my project. i did the Following

Solution:
1 - Go to the folder containing the solution files and delete the following: mssccprj.scc
MyProject.vssscc
vssver.scc

2 - Open MyProject.sln in your favorite text editor and remove the following section:
GlobalSection(SourceCodeControl) = preSolution ... EndGlobalSection
3 - Go to the folder containing the project files and delete the following: MyProject.vbproj.vspscc
mssccprj.scc
vssver.scc
4 - Open MyProject.vbproj in your text editor and remove the following lines:
SccProjectName = "SAK"
SccLocalPath = "SAK"
SccAuxPath = "SAK"
SccProvider = "SAK"

Now you can open the solution/project with no source control errors.

Thank you