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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:20:26+00:00 2026-05-21T17:20:26+00:00

I am new to the pattern way of coding and would like to start

  • 0

I am new to the pattern way of coding and would like to start implementing patterns in my code. I have a webservice that has multiple operations and receives different xml inputs for each operation(having its own schema). I would like to implement a pattern to validate the input provided.

My design:
Have an interface IValidate
implement the interface to EntityAValidate, EntityBValidate etc..,
each implemented validate method will check for validity of the xml and also do the individual node validation such as the string cannot have special characters etc..,

My questions :
Can we use any other design? please let me know the pattern name
How can I reuse some common validations like numeric check, date check across operations
How can the selection of corresponding validator be done automatically?

  • 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-21T17:20:26+00:00Added an answer on May 21, 2026 at 5:20 pm

    Based on this statement “I have a webservice that has multiple operations and receives different xml inputs for each operation”, the Command Pattern would probably be a good fit. It would apply more generally though, it need not be specific to validation.

    The Command Pattern encapsulates each operation as an object, each derived from a common base class (call it class Operation) which provides an ‘execute’ method. From each incoming xml operation, you would instantiate the corresponding Operation sub-class, passing them to some operation processing entity who calls execute.

    You could build your validation into this, adding a “validate” method to your Operation base class. The processor could then “validate” each Operation before “execute”ing it.

    In general, I agree with the commenters on your post. You should study the design patterns themselves, then they’ll jump out at you when your solving problems. Don’t pick a pattern and try to cram it into an existing design.

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

Sidebar

Related Questions

I was implementing a singleton pattern.Here,I am creating a new instance of Singleton* in
I'm working on a new project and I'm using the repository pattern, I have
I'll start by saying that I'm new to cocoa development. I'm also surprised I
We're investigating a coding pattern in C# in which we'd like to use a
I am new to Android coding, but I have experience with Perl regex. I
I have implemented a quadtree in Mathematica. I am new to coding in a
Is there a way to pattern match in F# so that it will check
I have attempted to create a function that will replace multiple regular expression values
New to php .I'm working on an old code in which I have to
Created a group of related providers using the provider pattern. Now would like to

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.