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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:36:26+00:00 2026-06-15T19:36:26+00:00

I want all my layers BLL ,DAL and UI to share classes (concrete or

  • 0

I want all my layers BLL ,DAL and UI to share classes (concrete or interfaces).

Is this really a bad practice?

I prefer not to return datatables from my DAL methods but instead to return objects that BLL can use directly.

I want to have a separate VS project with the classes that all layers should know about.

Example: I want to define a lot class that all layers should be aware of. UI should be able to receive lot classes in order to display or make possible for the user to submit a lot to be processed. Also DAL should be able to query the db with lot classes and return them. BLL on the other hand should get these lots and apply business rules onto them.

If this is completely wrong what are the alternatives?

  • 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-06-15T19:36:27+00:00Added an answer on June 15, 2026 at 7:36 pm

    I want all my layers BLL,DAL and UI to share classes (concrete or
    interfaces).

    It depends on what type of classes. If you need them all to access common domain entities, then sure.

    The important part is what you allow those layers to do with those classes. Your client/UI layer shouldn’t be able to modify the domain entities (and persist them) without going through some centralized business logic. This means your DAL shouldn’t be accessible by your UI, although they can both share common entities, interfaces, etc…

    A common approach is something like this:

    UI -> BLL -> DAL -> Persistence storage (DB, file, etc…)

    Each of those layers can access commmon classes. As long the UI can’t directly access the DAL, you should be okay. You have a couple of options for this:

    • Make the BLL accessible through a service (WCF, etc…)
    • Put the DAL and BLL in the same project and make the DAL internal so only the BLL can access it

    You end up with something like:

    UI -> Service -> BLL -> DAL -> Persistence storage (DB, file, etc…)

    I would strongly recommend Patterns of Enterprise Application Architecture by Martin Fowler. It will provide you with a good foundation for layering your application.

    I prefer not to return datatables from my DAL methods but instead to
    return objects that BLL can use directly.

    That’s a good idea. This is where the idea of ORM comes into play. The DAL will typically know how to talk to the DB, and the DAL will also know how to convert DB-specific structures into your domain model. Domain entities go into, and back out of, the DAL. Within the DAL, domain entities are converted to DB-specific structures when persisting data. And the reverse happens: when the BLL requests data, the DAL retrieves the data and converts it to domain enties before passing it back out.

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

Sidebar

Related Questions

I want all CSV files in a directory, so I use glob('my/dir/*.CSV') This however
How can I share the auto-generated entity data model (generated object classes) amongst all
I want to convert this code into PHP, it's a function that hides layers
I want to retrieve all layers from a PSD file and get their name,
I want to inject the current user using @Inject @Current User across all layers
I can clear all the layers using mapControl.ClearLayers(), but I only want to clear
I have a class library with all my database logic. My DAL/BLL. I have
I want all products that contain images to be listed before products that do
I want all the views of Row in OnListItemClick() Actually I want to change
I want all my inno set up pages to look like below :

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.