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 741613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:39:09+00:00 2026-05-14T08:39:09+00:00

I am using layered architecture in dotnet (mostly I work on web projects). I

  • 0

I am using layered architecture in dotnet (mostly I work on web projects). I am confuse what layers should I use ?

I have small idea that there should be the following layers.

  1. user interface
  2. customer types (custom entities)
  3. business logic layer
  4. data access layer

My purpose is sure quality of work and maximum re-usability of code.

some one suggested to add common types layer in it. Please guide me what should be layers ? and in each layer what part should go ?

  • 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-14T08:39:10+00:00Added an answer on May 14, 2026 at 8:39 am

    It depends on what data access technology you are using.

    If you are using NHibernate, I would strongly recommend Repository-pattern along with some dependency Injection.

    If you are using Linq-to-sql, you should be using Active Data Record-pattern. In this case you may or may not use dependency injection.

    In case of Entity Framework, Unit-of-work-pattern can be used.

    Generally I arrange my VS2005/2008 – solution like this:

    alt text

    And, I arrange my codes like this:

    namespace MySolution.Entity
    {
        public interface IMyInterface
        {        
            int Save(MyClass obj);
        }
    }
    
    namespace MySolution.Entity
    {
        public class MyClass
        {
            IMyInterface _myDa;
    
            public MyClass(IMyInterface myDa)
            {
                _myDa = myDa;
            }
    
            private string _message;
            public string Message
            {
                get { return _message; }
                set { _message = value; }
            }
    
            public int Save()
            {
                return _myDa.Save(this);
            }
        }
    }
    
    using MySolution.Entity;
    namespace MySolution.Service
    {
        public class MyClassService : IMyInterface
        {
            public int Save(MyClass obj)
            {
                Console.WriteLine(obj.Message);
    
                return 1;
            }
        }
    }
    
    using MySolution.Entity;
    using MySolution.Service;
    namespace MySolution.UI
    {
        class Program
        {
            static void Main(string[] args)
            {
                MyClass myobj = new MyClass(new MyClassService());
                myobj.Message = "Goodbye Circular Dependency!";
                myobj.Save();
    
                Console.ReadLine();
            }
        }
    }
    

    You can put IMyInterface.cs in a separate project named MySolution.Contracs. And, then add a reference of it to the respective assembly.

    Please note that, this is called layered-design, not tiered-design.

    You can also employ a simple framework for your business-entities like the one used in this example.

    And finally employ MVC pattern in your Winforms UI layer. You can get the example here.

    And I am not providing any link for ASP.NET MVC, coz there are numerous in the net.

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

Sidebar

Ask A Question

Stats

  • Questions 368k
  • Answers 368k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The Entity Framework designer is terrible - I've had the… May 14, 2026 at 5:11 pm
  • Editorial Team
    Editorial Team added an answer If by "hijack" you meant sniff the packets then what… May 14, 2026 at 5:11 pm
  • Editorial Team
    Editorial Team added an answer If you want two actions to be atomic, embed them… May 14, 2026 at 5:11 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.