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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:55:44+00:00 2026-06-03T18:55:44+00:00

I’ve started working on a WebForms (not MVC) application that will reside on a

  • 0

I’ve started working on a WebForms (not MVC) application that will reside on a single server (database included) and have decided to design it using what (I think) is a pretty standard N-Tier architecture.

Data Layer

  • Using Entity Framework 4 & generic repository/unit of work pattern.
  • Will be using stored procedures extensively (this is a requirement given to me by the powers that be).
  • Holds a reference to the Business Objects layer to pass data to/from the BOs.

Business Objects ‘Layer’

  • Code-first POCOs.
  • The only behaviour they will have is validation stuff (name not null, quantity must be positive integer etc).
  • Does not reference any of the other layers or care about where the data is coming from.

Business Logic Layer

  • Contains my business services that will act as the middle-man between the UI and data layers and performs additional business ‘rules’ such as email notifications upon record changes etc.
  • Has a reference to the data layer & business objects layer.
  • Passes BOs to/from the UI.

UI Layer

  • Holds all the usual UI stuff – web forms, javascripts, stylesheets etc.
  • References the Business Logic & Business Objects layers.

Few questions…well, alot actually :/

  1. I can see the advantages of using DTOs when the application is going to sit across multiple servers, will be using web services, or when the data passed to the view is a compilation of multiple types of business objects, but is there really a need to convert all BOs to DTOs before passing them between the BLL & UI when everything will be on the same physical machine? Most of the DTOs would be a “copy, paste, tack ‘DTO’ to the end of the classname” affair so it seems like a really pointless waste of time? All I’d end up with is higher maintenance costs and marginally slower performance (have to update two classes with identical code now instead of one).
  2. Assuming there will be occasions where DTOs are required, is it acceptable to add validation to the DTOs (ie: name must not be null, quantity must be a positive integer etc).?
  3. Would it be best/better practise to seperate the validation code into it’s own class library using something like FluentValidation? If I did this the BOs would basically become DTOs because they’d have zero behaviour..in which case it seems I would end up with an anaemic domain model?
  4. Is it acceptable for the data layer to reference the business objects layer when the BOs are used by EF?
  5. Seeing as my service “Find( predicate )” and “FindAll( ) ” methods would be using the same stored procedure (that pulls ALL records), does this mean that doing something like:

    List<Foo> myFoo = FooService.Find( f => f.Country == "Australia" && f.Status = OrderStatus.New );
    

would actually pull ALL records via the stored procedure, with the filtering performed after the fact? In which case how can I use a stored procedure that only retrieves the needed records, while at the same time allowing for the use of linq expressions (needs to allow for &&, ||, != etc)? Is this something that’s even possible (without having to ditch sprocs)?

  • 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-03T18:56:02+00:00Added an answer on June 3, 2026 at 6:56 pm

    I think it’s an over-architecture if it will be a monolithic application.
    Following YAGNI and DRY, just make your services return the BOs. I also recommend using MVP pattern when working with WebForms and even avoid the “service layer” and just do Domain Driven Design (DDD) instead.

    http://en.wikipedia.org/wiki/Domain-driven_design

    http://en.wikipedia.org/wiki/Don‘t_repeat_yourself

    http://en.wikipedia.org/wiki/You_ain‘t_gonna_need_it

    http://www.codeproject.com/Articles/23562/Building-an-MVP-Framework-for-NET-Part-1-The-Basic

    MVP is really easy to implement. The explanations will be always full of components and arrows, and the sample implementations always try to make things complex (I don’t know why), but is really a simple pattern for separation of concerns and it really works 🙂

    Hope it helps 🙂

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

Sidebar

Related Questions

I need a function that will clean a strings' special characters. I do NOT
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a reasonable size flat file database of text documents mostly saved in
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.