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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:27:59+00:00 2026-05-24T08:27:59+00:00

Do you use aggregate root (AR) types for event parameters? For example, the first

  • 0

Do you use aggregate root (AR) types for event parameters?

For example, the first method works with simple types but the second uses complex types. Why do you prefer the first or the second?

AggregateRoot()
{
    private SomeAR _someAR;

    public void DoSomething(SomeAR someAR)
    {
        // Validation and other similar stuff.
        ApplyEvent(new SomethingHappenedEvent(someAR.StringText));
    }

    public void DoAnything(SomeAR someAR )
    {
        ApplyEvent(new NothingHappenedEvent(this, someAR));
    }

    protected void OnDoSomething(SomethingHappenedEvent e)
    {
        _someAR = ???
    }
}
  • 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-24T08:27:59+00:00Added an answer on May 24, 2026 at 8:27 am

    Do question why you are passing in that entity and/or aggregate. What is it that you are really after from those objects? I’ll tell you, it’s their state or a side-effect free function that produces state you want to put in that event.

    Coupling your events to your aggregates/entities is going to be hard on your consumers, especially if messaging is involved. Pretty soon you’ll be sprinkling serialization attributes on your aggregate’s/entity’s state (be it fields or properties). Maybe you’ll start to introduce state to be able to give the event the data it wants upon serialization. Bad idea, because you’re giving your aggregates/entities a responsibility – keeping track of state for purposes other than its own behavior – they shouldn’t have in the first place.

    It’s not only the coupling and messaging, it’s also a matter of choice: the freedom to represents things differently on the inside (aggregates/entities) and on the outside (events/commands). Most domain objects on the inside are all about behavior, while on the outside the event/command objects are about carrying state and intent forward.

    All that said, there’s nothing wrong with double-dispatching into an object to get to it’s state.

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

Sidebar

Related Questions

use this website a lot but first time posting. My program creates a number
trying to use this route: from(activemq:profiles).aggregate(header(cheese)).batchSize(30).bean(ProfilesQueueService, saveContacts) Fails with: No signature of method: org.apache.camel.model.RouteType.aggregate()
I have an Aggregate field in a client data set and I use a
I want to use Event Aggregator to allow communication between presenters on the page.
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
I have several query results that use one or more aggregate functions and a
lets say i have a BlogPost aggregate root. it holds a List <Comment> .
I wish to use Entity Framework Code-first for a new project. So i decided
First I'm not mad, because I use MVVM in WinForms-) I know about MVP
Whenever we use an aggregate function in SQL ( MIN , MAX , AVG

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.