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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:03:05+00:00 2026-05-21T15:03:05+00:00

I’m curious if this is a crazy idea. Right now I have a typical

  • 0

I’m curious if this is a crazy idea. Right now I have a typical structure as follows

Client (currently asp.net mvc3, but could be anything in the future)
WCF Service layer
Domain Layer
Data Layer

I have some very complex validation done in my domain layer. DataAnnotations doesn’t suffice. So, that validation is done in a more manual way, but still passed back through the service layer to the client.

However, there is simple validation (field not null, must be greater than 0, can’t be more than 10 chars) that DataAnnotations would be good for.

Here’s my plan. I will already be distributing a basic DataContract dll that has DTO objects. This is because I have multiple WCF services. I plan to create an assembly that has the buddy metadata class with DataAnnotations attributes. This class is then used for BOTH my DTO and my domain entity. This way I can get simple validation without going through the web service, but it’s still all in one place. However, for clients that don’t support that (say java for example), they’d still get validation if they went through the WCF service.

Originally I didn’t want to distribute anything to the client, but in order to share DataContracts among services, I have to anyway.

Is this a crazy idea? I know other people are just doing some double validation. Is there a better way to implement this? I have tested it and it does work but I’m not sure how well it will scale when my entire model is built out (just prototyping right now).

Thanks

  • 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-21T15:03:06+00:00Added an answer on May 21, 2026 at 3:03 pm

    There is nothing wrong with that approach. Separating your DataContracts into a separate assembly and sharing those contracts with .NET clients is a best practice in my opinion, it sounds like you’re just taking it one step further and sharing validation assembly as well.

    I also share my ServiceContracts with .NET clients, that way clients do not have to add service references, which is icky poo.

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

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text

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.