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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:11:37+00:00 2026-05-13T01:11:37+00:00

I am a fairly rookie programmer who is trying to learn the basics of

  • 0

I am a fairly rookie programmer who is trying to learn the basics of n-layered architecture (DAL, BLL, UI). The application I am programming is a single tier, 3-layer application written in VB.NET (.Net 3.5). Layers as follows:

DAL

BLL

UI

COMMON – contains DTO’s right now.

I am having trouble determining what to pass between my BLL and UI. My instinct tells me that I should only pass data to the UI, and not the full business object from the BLL. Consider two scenarios:

1) Pass the BO directly from BLL to UI. This exposes BO methods and allows the UI direct access to the BO, which seems bad.

2) Pass only the pertinent data from the BO to the UI. For instance, a customer has a Name and Address. This data is really what we want to show/edit in the UI, so we would only return that data to the UI instead of the full BO. The UI would then call to the BLL to update a specific BO.

I am inclined to use #2, but I don’t know the best way to implement it. The way I have it programmed now, if I only return data from the BLL, all references to my BO’s will be lost and the GC will claim them. Based on this, I have some questions:

1) Should I keep business objects alive between calls to the BLL? The alternative is to re-create them every time I pass data through the BLL, which seems wrong.

2) What is the best way to keep a BO alive in a single tier architecture (how to hold a reference if we dont pass it to the UI?)

3) How do n-tier applications do this? Do they keep the BO’s alive in the BLL and wait for an update from the UI? Doesn’t this require a lot of “book keeping” in the BLL to make sure BO’s are released when they are no longer needed?

Thanks for any insight, and pardon me if I am asking something stupid. I taught myself the little programming I know, so I may be asking a stupid question and not know it.

  • 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-13T01:11:38+00:00Added an answer on May 13, 2026 at 1:11 am

    See Pet Shop as an example of 3 layer architecture. I’ll implement both BLL and DAL as service object, which on its own does not hold any states. Since they are stateless, I can use singleton pattern and let a factory hold on to it for easy reference.

    Here are some example CRUD methods you could have:

    FooInfo DALFactory.FooService.Retrieve(int id);
    FooInfo BLLFactory.FooService.Retrieve(int id);
    
    IList<FooInfo> DALFactory.FooService.RetrieveAll;
    IList<FooInfo> BLLFactory.FooService.RetrieveAll;
    
    FooInfo DALFactory.FooService.Create(FooInfo entity);
    FooInfo BLLFactory.FooService.Create(FooInfo entity);
    
    FooInfo DALFactory.FooService.Edit(FooInfo entity);
    FooInfo BLLFactory.FooService.Edit(FooInfo entity);
    
    void DALFactory.FooService.Delete(FooInfo entity);
    void BLLFactory.FooService.Delete(FooInfo entity);
    

    As you can see in both cases, you pass the same entity object (aka data transfer object) that has no logic whatsoever. This architecture allows you to disconnect UI layer from BLL down the line to rich client and web services combo.

    The intension of the Retrieve and RetrieveAll method is to grab the data from the database and stuff it into entity object. Create method adds a new row to the database based on the given entity. In this architecture, there is no “business object” besides Business Logic Layer’s BLLFactory.FooService and the entity FooInfo object.

    In terms of the lifetime of these objects, the stateless BLLFactory.FooService is created once, and will be reused as long as the app is alive. FooInfo could be created once per object, and then persisted into the ASP.NET session or something.

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

Sidebar

Related Questions

Fairly new to programming. I just can't wrap my head around how to get
Fairly straightforward question here, but I can't seem to find someone who has asked
Fairly new to Objective C and trying to work within Storyboards given it's the
Fairly new to socket programming, but I've been assigned with a whopper of project.
Fairly new to jQuery, trying to use Autocomplete. Went to http://jqueryui.com/download to build my
What I'm trying to do is fairly simple. I have two classes: public class
Fairly experienced programmer but new to CakePHP 2.1 and spending my day struggling to
In fairly large Ruby application, we have a situation where a given object is
Being fairly new to objective-c and developing for ios I'm trying to figure out
Fairly new to ruby. I'm trying to parse a string and assign several variables

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.