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

  • Home
  • SEARCH
  • 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 3597592
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:08:18+00:00 2026-05-18T20:08:18+00:00

Where should I place the Validation logic of the Domain objects in my solution?

  • 0

Where should I place the Validation logic of the Domain objects in my solution? Should I put them in the Domain classes, Business layer or else?

I would also like to make use of Validation Application Block and Policy Injection Application Block from Microsoft Enterprise Library for this.

What validation strategy should I be using to fit all these together nicely?

Thanks all in advance!

  • 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-18T20:08:18+00:00Added an answer on May 18, 2026 at 8:08 pm

    It depends. First – You need to understand what You are validating.

    You might validate:

    1. that value You retrieve from Http post can be parsed as date time,
    2. that Customer.Name is not larger than 100 symbols,
    3. that Customer has enough money to purchase stuff.

    As You can see – these validations are different in nature, so they should be separated. Importance of them varies too (see “All rules aren’t created equal” paragraph).


    Thing You might want to consider is not allowing domain object to be in invalid state.

    That will greatly reduce complexity because at current time frame, You know that object is valid and You need to validate only current task related things in order to advance.

    Also, You should consider avoiding usage of tools in Your domain model because it should be infrastructure free as much as possible.

    Another thing – embrace usage of value objects. Those are great for validation encapsulation.

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

Sidebar

Related Questions

Where should I place the Validation logic of the Domain objects in my solution?
Should you place the @Transactional in the DAO classes and/or their methods or is
Should be simple but I couldn't find the answer, I would like to place
Is there a consensus about the best place to put Python unittests? Should the
What's the best place to implement validation logic code and conditional formatting code for
I am currently writing some unit tests for a business-logic class that includes validation
We say that model validation at controllers layer is the correct place to validate
I am trying to figure out how to use Validation on Business Objects. Until
I am not sure where the best place to put validation (using the Enterprise
In .NET should you place unit test projects in with the rest of 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.