Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6927009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:59:33+00:00 2026-05-27T10:59:33+00:00

i need some suggestion for working on 3 tier architecture, recently i completed one

  • 0

i need some suggestion for working on 3 tier architecture, recently i completed one of my clients site, with 3 tier architecture, in that i was transforming the data directly in html from sql server 2008 and fetching the records in .net, .net was just doing the rendering task, so one of my friend said, it could reduce the performance drastically, but i never got any complaint from client regarding the same, as the records i am transforming in html from sql server 2008, is not more than max 10, and now for the second site, i want to take more precaution while rendering data on the site, now this time i have planned to again use 3 tier, but now instead of transforming data to html in sql server i am pulling the records from sql server 2008, to my datalogic layer, and in bussinesslogic layer, i am transforming it to HTML.. so can anyone suggest which is the best way to go about, the previous tranforming in HTML in SQL SERVER or in .NET

By Transforming in HTML i mean:

ALTER PROCEDURE [dbo].[SP_TVT_Article_Get]
    @ID INT
AS
BEGIN
    DECLARE @HTML NVARCHAR(MAX)
    SET @HTML = '';
    SELECT @HTML = '
    <div style="margin-top:10px;" class="craig"><span style='+(SELECT CASE ISNULL(Author, '') WHEN '' THEN '"display:none; float:left"' ELSE '"display:block; float:left"' END)+'> ' + ISNULL(C.Author, '' )+ ' /</span> ' + DATENAME(DW, C.PublishDate) + ' ' + CONVERT(VARCHAR(15), CAST(C.PublishDate AS TIME), 100) +'</div>
    <div class="sony_title">'+C.Title+'</div>' +
    CASE 
    WHEN C.SecondaryTitle IS NOT NULL THEN    
    '<div class="tokiyo">' + C.SecondaryTitle + '</div>
    'ELSE
    '<div class="tokiyo">TOKYO: Six broadcasters & theaters in at least 22 will carry 3D coverage.</div>'
    END +
    '<div class="imgtxt_para01"> <img src="'+isnull(C.Thumbnail,'')+'" style="'+(SELECT CASE ISNULL(C.Thumbnail,'') WHEN '' THEN '"display:none"' ELSE '"display:block"' END)+'" /> 
    '+ CAST(C.Article AS NVARCHAR(MAX)) +'</div>'
     FROM CrossArticle_Article C
     WHERE Id = @ID

     SELECT @HTML
END

and this time which i am planning to do is like this..
My DataLogic Layer, will look like this:

  public void GetArticle(int PortalID, int ArticleID, out DateTime PublishDate, out string Article, out string Author, out string Title)
    {
        object _getArticle = "";
        Article = Author = Title = null;
        PublishDate = DateTime.Now;
        using (SqlCommand comGetArticle = new SqlCommand("sp_EQEM_GetArticle", ConnectDatabase))
        {
            comGetArticle.CommandType = CommandType.StoredProcedure;
            comGetArticle.Parameters.AddRange(new SqlParameter[]{new SqlParameter("@PortalID", PortalID),
                                                                 new SqlParameter("@ArticleID", ArticleID)});
            ConnectDatabase.Open();
            using (SqlDataReader reader = comGetArticle.ExecuteReader())
            {
                while (reader.Read())
                {
                    Title = reader.GetValue(0).ToString();
                    Author = reader.GetValue(1).ToString();
                    PublishDate = Convert.ToDateTime(reader.GetValue(2));
                    Article = reader.GetValue(3).ToString();
                }
            }
            ConnectDatabase.Close();
        }
    }

and bussinesslogic layer will look like this:

   public object GetArticle()
    {
        string Title, Author, Article;
        DateTime PublishDate;
        connection.GetArticle(PortalID, ArticleID, out PublishDate, out Article, out Author, out Title);
        StringBuilder str = new StringBuilder();
        str.Append("<div class='aricle_para'>");
        str.Append("<h1>" + Title + "</h1>");
        str.Append("<span style='float:left; display:" + (String.IsNullOrEmpty(Author) ? "none" : "block") + "'>By " + Author + "&nbsp; | </span><span>&nbsp; " + PublishDate.DayOfWeek.ToString().Substring(0, 3) + ", " + PublishDate.ToString("dd MMM yyyy") + "</span><br />");
        str.Append(HttpContext.Current.Server.HtmlDecode(Article));
        str.Append("</div>");
        return str.ToString();
    }

and then i will be calling the bussinesslayer function GetArticle to the page, where i want to render article…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:59:34+00:00Added an answer on May 27, 2026 at 10:59 am

    A “tier” in an n-tier architecture is so called because it is functionally distinct from other parts of the application; in fact, it’s more correct to say it’s isolated from even the question of whether it’s used in one or n applications.

    “Layers” commonly refer to distinct groups of functionality within one tier.

    “3-tier” applications came about because the pattern of using Data Access, Business Logic and Presentation in three distinct tiers is a quick fit for many scenarios, but it’s by no means prescriptive that you need 3 tiers. The point is primarily that you have tiers at all.

    In order to qualify as a tier, broadly speaking its responsibilities must not bleed in to another. By having a stored procedure in your database that returns HTML, you are bleeding presentation markup up into your business logic tier (of your chosen 3-tier approach) and then further outwards into your presentation logic.

    You will find everything far simpler to test, and make performant, by returning only data from your stored procedures. Your business logic can process this data, choosing what (if any) filters, modifications and workflows to apply, and add metadata to that data before passing it outwards to your presentation tier that is solely responsible for placing that data inside of your HTML markup. In this way, your presentation tier is kept distinct, and you may then add layers to it that can generate markup for mobile applications, or JSON for RESTful services responses, etc. – all without the stored procedures caring.

    Your friend’s comments about performance optimisations were the tip of the iceberg, but may have referred to a natural consequence of keeping this separation: you would not be concatenating strings in your stored procedure to generate markup that is then further modified in your business logic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
Need some help assigning a mouseover event to display some icons that start out
So the site I'm working on has a filter system that operates by passing
How Guys I'm working on a project that need display same thing like this,
I Am working on a 2D game in XNA that needs some physics. I
I'm currently working with an NSPersistentDocument subclass that uses NSOperation to import data in
I need some asp.net pagination code samples. I would like suggestions on open source
Need some help to solve this. I have a gridview and inside the gridview
Need some guidance figuring out what went wrong. I've been using mysql, phpmyadmin for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.