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

  • Home
  • SEARCH
  • 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 542399
In Process

The Archive Base Latest Questions

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

Presently I am working using single tier architecture. Now I am wanting to learn

  • 0

Presently I am working using single tier architecture. Now I am wanting to learn how to write code using 3 tier architecture. Please can you provide me with a simple example?

  • 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-13T10:26:33+00:00Added an answer on May 13, 2026 at 10:26 am

    This is what I have in my project. More than just a traditional 3-tier architecture.

    1.) Application.Infrastructure

    • Base classes for all businessobjects, busines object collection, data-access classes and my custom attributes and utilities as extension methods, Generic validation framework. This determines overall behavior organization of my final .net application.

    2.) Application.DataModel

    • Typed Dataset for the Database.
    • TableAdapters extended to incorporate Transactions and other features I may need.

    3.) Application.DataAccess

    • Data access classes.
    • Actual place where Database actions are queried using underlying Typed Dataset.

    4.) Application.DomainObjects

    • Business objects and Business object collections.
    • Enums.

    5.) Application.BusinessLayer

    • Provides manager classes accessible from Presentation layer.
    • HttpHandlers.
    • My own Page base class.
    • More things go here..

    6.) Application.WebClient or Application.WindowsClient

    • My presentation layer
    • Takes references from Application.BusinessLayer and Application.BusinessObjects.

    Application.BusinessObjects are used across the application and they travel across all layers whenever neeeded [except Application.DataModel and Application.Infrastructure]

    All my queries are defined only Application.DataModel.

    Application.DataAccess returns or takes Business objects as part of any data-access operation. Business objects are created with the help of reflection attributes. Each business object is marked with an attribute mapping to target table in database and properties within the business object are marked with attributes mapping to target coloumn in respective data-base table.

    My validation framework lets me validate each field with the help of designated ValidationAttribute.

    My framrwork heavily uses Attributes to automate most of the tedious tasks like mapping and validation. I can also new feature as new aspect in the framework.

    A sample business object would look like this in my application.

    User.cs

    [TableMapping("Users")]
    public class User : EntityBase
    {
        #region Constructor(s)
        public AppUser()
        {
            BookCollection = new BookCollection();
        }
        #endregion
    
        #region Properties
    
        #region Default Properties - Direct Field Mapping using DataFieldMappingAttribute
    
        private System.Int32 _UserId;
    
        private System.String _FirstName;
        private System.String _LastName;
        private System.String _UserName;
        private System.Boolean _IsActive;
    
        [DataFieldMapping("UserID")]
        [DataObjectFieldAttribute(true, true, false)]
        [NotNullOrEmpty(Message = "UserID From Users Table Is Required.")]
        public override int Id
        {
            get
            {
                return _UserId;
            }
            set
            {
                _UserId = value;
            }
        }
    
        [DataFieldMapping("UserName")]
        [Searchable]
        [NotNullOrEmpty(Message = "Username Is Required.")]
        public string UserName
        {
            get
            {
                return _UserName;
            }
            set
            {
                _UserName = value;
            }
        }
    
        [DataFieldMapping("FirstName")]
        [Searchable]
        public string FirstName
        {
            get
            {
                return _FirstName;
            }
            set
            {
                _FirstName = value;
            }
        }
    
        [DataFieldMapping("LastName")]
        [Searchable]
        public string LastName
        {
            get
            {
                return _LastName;
            }
            set
            {
                _LastName = value;
            }
        }
    
        [DataFieldMapping("IsActive")]
        public bool IsActive
        {
            get
            {
                return _IsActive;
            }
            set
            {
                _IsActive = value;
            }
        }
    
        #region One-To-Many Mappings
        public BookCollection Books { get; set; }
    
        #endregion
    
        #region Derived Properties
        public string FullName { get { return this.FirstName + " " + this.LastName; } }
    
        #endregion
    
        #endregion
    
        public override bool Validate()
        {
            bool baseValid = base.Validate();
            bool localValid = Books.Validate();
            return baseValid && localValid;
        }
    }
    

    BookCollection.cs

    /// <summary>
    /// The BookCollection class is designed to work with lists of instances of Book.
    /// </summary>
    public class BookCollection : EntityCollectionBase<Book>
    {
        /// <summary>
        /// Initializes a new instance of the BookCollection class.
        /// </summary>
        public BookCollection()
        {
        }
    
        /// <summary>
        /// Initializes a new instance of the BookCollection class.
        /// </summary>
        public BookCollection (IList<Book> initialList)
            : base(initialList)
        {
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using geasessions for a while, been working great. It's simple and fast.
You do you manage the same presenter working with different repositories using the MVP
I am presently working on converting a 32-bit application into a 64-bit application in
Presently I have a some legacy code, which generates the op code. If the
I am working on a project where I can to convert a api digit
At present we are using Fedora Core 3 for a system we are working
I am using protobuf-net on the project I am working on for the data
I am working with Cassandra 0.6.5 using the thrift interface. I am trying to
Presently, we've got several main projects each in their own repository. We will have
Presently I'm starting to introduce the concept of Mock objects into my Unit Tests.

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.