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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:48:46+00:00 2026-05-15T23:48:46+00:00

Just trying to get some opinions on whether or not CommandHandlers can/should communicate with

  • 0

Just trying to get some opinions on whether or not CommandHandlers can/should communicate with other CommandHandlers.

Here is a simple case I just ran into. I have a ChangePasswordCommandHandler who’s command looks like the following:

public class ChangePasswordCommand : Command
{
    public string Email { get; }
    public string OldPassword { get; set; }
    public string NewPassword { get; set; }
}

So, inside the handler I need to validate the users olds password, so as I see it I have three options:

  1. dispatch out a call to my ValidateCredentialsCommandHandler.
  2. factor out some of the validation logic into a service that both handlers can use.
  3. have the calling process do this check first, but now business logic is leaking outside of my domain layer.

I’m running into a few technical issues with dispatching to other handlers mostly b/c i’m using a transaction per-web request, so i have two transactions trying to contend.

Thoughts?

  • 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-15T23:48:46+00:00Added an answer on May 15, 2026 at 11:48 pm

    Command handler handles command. If ChangePasswordCommandHandler dispatches validation to ValidateCredentialsCommandHandler, what command does ValidateCredentialsCommandHandler handles then?

    In short – no, i don’t think that makes sense.

    2nd option sounds best from ones You mentioned.

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

Sidebar

Related Questions

Im trying to get this working but for some reason it's just not right.
I am just trying to get some things to work so I can try
Just trying to get some rows out of a database and loop through but
So I just recently bought some web hosting and I'm trying to get my
Just trying to get my head around what can happen when things go wrong
I'm just trying to get the numbers that are in a sentence. They can
I'm just trying to get a simple example of accessing a custom java class
I've been struggling with this for some time now. I'm just trying to get
Just trying to get some perspective about how to retrieve data from umbraco via
I'm just learning C# and trying to get some practice working with classes as

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.