Introduction
Well, this is my fourteenth article. I have updated "A Tool to create N-Layer Architecture Classes" article with version 2.0
What is N-Layer Architecture?
This is a very important topic to consider when developing an application. Many elements need to be considered when deciding on the architecture of the application, such as performance, scalability and future development issues. When you are deciding on which architecture to use, first decide on which of the three aforementioned elements you think is most valuable -- as some choices you make will impact on others. For example, some choices that boost performance will impact the scalability or future development of your design, etc.
Here we will talk generally about what n-Tier architecture is, and then we will have a look at different n-Tier architectures you can use to develop ASP.NET applications and issues that arise relating to performance, scalability and future development issues for each one.
Firstly, what is n-Tier architecture? N-Tier architecture refers to the architecture of an application that has at least 3 "logical" layers -- or parts -- that are separate. Each layer interacts with only the layer directly below, and has a specific function that it is responsible for.
Why use n-Tier architecture? Because each layer can be located on physically different servers with only minor code changes, hence they scale out and handle more server load. Also, what each layer does internally is completely hidden to other layers and this makes it possible to change or update one layer without recompiling or modifying other layers.
This is a very powerful feature of n-Tier architecture, as additional features or change to a layer can be done without redeploying the whole application. For example, by separating data access code from the business logic code, when the database servers change you only need to change the data access code. Because business logic code stays the same, the business logic code does not need to be modified or recompiled.
An n-Tier application usually has three tiers, and they are called the presentation tier, the business tier and the data tier. Let's have a look at what each tier is responsible for.
Description about the Tool
Basically to create classes for the n-layer architecture, we need write code considering the table structure and write codes for business logic and data access layers separately. Also if the database has some more number of tables, we need to spend more time in creating the classes for each and every table.
So to simplify this, I developed this tool. The tool creates the business object classes, business logic layer class, Data access layer class. The tool creates with basic functionalities. If we want to add any extra functionalities, we can edit it separately by opening it in any IDE (of course Visual Studio).
Screenshots
New Features included in version 2.0
- Create multiple classes for multiple tables.
- Create Stored Procedures for the tables to use in DAL for insert, select, update and delete.
- Create classes in single file or in separate files.
- Place connection string in inline or App.Config or Web.Config
History
Version 1.0 - http://www.codeproject.com/Articles/227708/A-Tool-to-create-N-Layer-Architecture-Classes
Fixed some issues that was in version 1.0
Conclusion
Thanks for reading this article. I expect feedback from you. You expect more from me.