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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:04:52+00:00 2026-05-24T11:04:52+00:00

Suppose you have an application that utilizes the domain-model pattern, DDD and lots of

  • 0

Suppose you have an application that utilizes the domain-model pattern, DDD and lots of other design patterns. assume that we have a number of solutions as listed below:

  • Solution.Model
  • Solution.Repository
  • Solution.Services
  • Solution.Presentation
  • Solution.UI.Web

The user experience layer will be Solution.UI.Web and we’ll assume that it’ll be an ASP.NET WebForms application. how do you enforce client-side validation?

There are a number of things to be considered:

First and foremost, we shouldn’t have to hit the application/database server(s) to return any validation errors to the client, we could however implement server-side validation too, but we’re gonna need client-side validation as well.

Second, we don’t want to implement the validation rules on the user experience layer. that’s because if your application is a WebApp and then you decide to create a WinApp client as well, you’re gonna have to implement the validation rules all over again –> maintenance nightmare.

One simple approach would be to implement your validation logic withing your ViewModel objects (flattened views of your domain entities that will be sent to the client) and then validate those objects before hitting the application/database server(s).

Another approach, one that I have seen used many times in different applications, is to just generate a collection of validation error messages and send that collection to the client. that’s fine, but there’s a problem. just a simple summary message of validation errors won’t do, specially if you have big data entry form.

Now the ASP.NET MVC framework makes life much easier. you can use EF + DataAnnotations, and MVC Scaffolding framework can do most of the job for you. but that’s the case if you want to create an MVC application and implement your validation logic with jQuery and JavaScript.

But what if you need a more generic approach to implement a validation framework that can be utilized and used in different applications, say WinForms and WebForms ?

Just to clarify, what im looking for is a set of design patterns/principles and/or techniques/frameworks to implement a validation framework that can be implemented withing your domain model and then be enforced on your client applications. And, I don’t want to just return a collection of string error messages about the broken rules or anything, I want to be able to update my data-bound controls (TextBox, ComboBox, DateTimePicker, etc) upon validation failure so that the user experience layer would be more intuitive (if you will).

I have seen some implementations and frameworks here and there, and I have used ASP.NET MVC client-side validation for a while now, so my answer doesn’t have anything to do with MVC or JavaScript validation.

  • 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-24T11:04:54+00:00Added an answer on May 24, 2026 at 11:04 am

    I have not come across an all encompassing validation solution. One reason for this is that validation logic can be subtly different depending on the application layer. For example, not all rules enforced by the domain layer can be enforced on the client side and so there will always be cases where client side validation may pass and yet you still need to display a validation message which propagated from the domain layer.

    However, the validation model in ASP.NET MVC is extensible and you can extend it to support additional validation rules or event a validation framework other than DataAnnotations. Here is an example of integrating Enterprise Library Validation block with ASP.NET MVC, however as the article points out, client side validation was not implemented. Another approach would be to use DataAnnotations attributes in your domain layer. The DataAnnotations namespace is not tied to ASP.NET MVC.

    The challenge in these approaches however is that of propagating validation rules from domain objects to view models. In theory, you can extend AutoMapper such that validation rules from a domain model are carried over to view model classes, however the cost of implementation and maintenance may outweigh the benefits of this solution.

    The Fluent Validation framework could be used as a starting point for an all encompassing validation solution. There are many examples of using this framework with ASP.NET MVC.

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

Sidebar

Related Questions

Suppose you have two seperate ASP.NET Web Application projects that both need to use
Suppose I have an application that access data resident in a central DB server
Suppose I have a Java application that opens a database connection. Normally I would
My application I have an application design that looks like this: web application layer
I'm implementing an application that will have a lot of clients querying lots of
Suppose you have an application that consists of two layers: A: A data layer
Suppose I have an application that will draw 20 little UIImageViews on the screen.
Lets suppose I have an .NET client application that connects to a WCF service,
Suppose we have an application that's stable. Tomorrow, someone reports a big ol' bug
I'm trying to design application that will have UI with database in the backend.

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.