ASP.Net Application Design

asp.net India
  • 18 years ago

    I am developing a website using ASP.Net and SQL server. Application design consistes of three logical layers 1) Presentation layer 2) Business Layer 3) Data Layer.


    In the present design, the presentation layer has the .aspx pages. It takes user input, instantiates business object and calls the business method.


    The business object in turn instantiates corresponding data object and calls the data object method.


    The data object method executes stored procedures to access the database.


    I feel drawback of this design is that for a single user request, minimum two objects have to be instantiated, the business object and the data object. Object creation is an expensive operation and impacts the application performance.


    My query is, is it a good idea to declare all methods of data objects as public shared, so that they can be called from the business objects without having to instantiate the data class. This will mean that the data layer of my application contains classes with all methods as shared. Will this have any adverse impact?


  • 18 years ago

    I would recommend combining the business layer and data layer for web applications. Also look into caching data, saving data to xml files etc. Specifically I would make alot of use of the caching api for presentation of data especially when it doesn't change that much. You can set up pages to cache until data changes by good use of the cache api.
    3 tier has no real advantage for the web. Most of the microsoft sample sites that you can download uses 2 layers - the webpages with code behind instantiating objects that send and fetch data.

  • 18 years ago

    no, instantiation isn't that expensive. (When you use string variable or even integrer variable ur instantiating it. So unless your constructor does something heavy...it isn't that intensive)But, what i do is set the methods of Data Tier static so that there is no need for instantiation.


    when i use ECC pattern, I also use static methods for the engine class and the only thing i need to instantiate is the container class which is just a collection of different variables.

  • 18 years ago

    hmm i have to disagree ther with musician


    Most of the MS sample apps are 3 tiers. (ALL actually) They are 3 logical tiers. I think ur confused with the physical tiers. eg. ibuyspy has 3 logical tiers and 2 or 1 physical tiers(depending on where sqlserver is )


    What vibha told us is 4 logical tier design. Which is very common among websites.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“To iterate is human, to recurse divine” - L. Peter Deutsch