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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:11:26+00:00 2026-05-23T14:11:26+00:00

I’m trying to create a simple three tier project and I’m on track on

  • 0

I’m trying to create a simple three tier project and I’m on track on implementing the Business Logic layer, right now, this is how my BL looks like

//The Entity/BO
public Customer
{
    public int CustomerID { get; set; }
    public string CustomerName { get; set; }
    public UserAccount UserAccount { get; set; }
    public List<Subscription> Subscriptions { get; set; }
 }

//The BO Manager
public class CustomerManager
{

     private CustomerDAL _dal = new CustomerDAL();

    private Customer _customer;

    public void Load(int customerID)
    {
        _customer = GetCustomerByID(customerID);
    }


    public Customer GetCustomer()
    {
        return _customer;
    }


    public Customer GetCustomerByID(int customerID)
    {

        return _dal.GetCustomerByID(customerID);
    }


    public Customer GetCustomer()
    {
        return _customer;
    }

    public UserAccount GetUsersAccount()
    {

        return _dal.GetUsersAccount(_customer.customerID);
    }

    public List<Subscription> GetSubscriptions()
    {
         // I load the subscriptions in the contained customer object, is this ok??
        _customer.Subscriptions = _customer.Subscriptions ?? _dal.GetCustomerSubscriptions(_customer.CustomerID);

        return _customer.Subscriptions;
    }

As you may notice, my object manager is really just a container of my real object (Customer) , and this is where I put my business logic, kinda way of decoupling the business entity to the business logic, this is how I typically use it

        int customerID1 = 1;
        int customerID2 = 2;

        customerManager.Load(1);

        //get customer1 object
        var customer = customerManager.GetCustomer();

        //get customer1 subscriptions
        var customerSubscriptions = customerManager.GetSubscriptions();

        //or this way
        //customerManager.GetSubscriptions();
        //var customerSubscriptions = customer.Subscriptions;


        customerManager.Load(2);

        //get customer2
        var newCustomer = customerManager.GetCustomer();

        //get customer2 subscriptions
        var customerSubscriptions = customerManager.GetSubscriptions();

As you can see it only holds 1 object at a time, And if i need to manage List of Customers, I probably have to create another manager like CustomerListManager

My question is, Is this the right way of implementing the BL of a three tier/layer design?
Or any suggestion on how would you implement it. Thanks.

  • 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-23T14:11:26+00:00Added an answer on May 23, 2026 at 2:11 pm

    As others have mentioned before you should have a look at the Repository pattern. I would also recommend to check out the Unit Of Work pattern as well as Domain Driven Design for your application’s architecture in general.

    You might also have a look into object relational-mapping (ORM) frameworks for .NET like Entity Framework or NHibernate if that’s an option for you.

    To give you a head-start here are some great resources to get you on the right road:

    Books

    • Applying Domain-Driven Design and Patterns by Jimmy Nilsson
    • Domain-Driven Design by Eric Evans
    • Domain Driven Design Quickly (Free eBook)

    Online References

    • Design Patterns for Data Persistence by Jeremy Miller
    • Repository is the new Singleton by Ayende Rahien
    • The Repository Pattern (MSDN)
    • The Unit Of Work Pattern And Persistence Ignorance by Jeremy Miller

    Hope that helps.

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.