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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:28:15+00:00 2026-06-01T02:28:15+00:00

When dealing with events, people are usually taking examples of very simple values object

  • 0

When dealing with events, people are usually taking examples of very simple values object composed only of primitives.
But what about an event where i would need more information. Is is allowed to create specific structure to handle these cases ?

namespace Events {
    public class BlueTrainCleaned
    {
         Datetime start
         Datetime end
         Carriage[] Carriages
    }

    public class Carriage
    {
         string Descrizione
         int Quantity
    }
}

The Carriage class is part of the event namespace and has not any complex logic or anything.

but if I had another event :

public class RedTrainCleaned
{
     Datetime start
     Datetime end
     Carriage[] Carriages
}

Carriage will be part of the interface of the second event also. If have let’s say 40 or 50 event with the same “event value object”, that means that my project will be heavily coupled on this object. It does not look so good to me, but what could I do to avoid this? Is it a warning that something in the analysis of my domain is not well done?

thanks for your help,

  • 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-06-01T02:28:17+00:00Added an answer on June 1, 2026 at 2:28 am

    I guess it depends on how standard Carriage is in your domain. If it changes for one event, should it change for the other ones, too?

    I guess I think of the example of Address. It’s pretty standard within a domain, and I think it makes sense to include that in my event object if I am raising an event that contains address information. This way, if it becomes known that we need to have a ZIP+4 extension to my zip code, I can add a new field to my Address class and have that property available for future events. I can make the change in a single place and have it available for future events.

    If Carriage could mean something different across different events, then maybe it’s not something you should include – and instead, flatten it out in your event. But if Carriage really is an ubiquitous definition within your domain, then I think it’s fine to include it in your event classes.

    As much as it may be frustrating to hear, I think it really “depends”.

    I hope this helps. Good luck!!

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

Sidebar

Related Questions

I was trying to create a very simple MySQL event and realized the action
JQuery events are annoying me. The thing is that I very often use javascript
I am dealing with a very peculiar problem at the moment: I have an
I'm doing a eCommerce website, but dealing Javascript is killing me. For example, for
I'm dealing with the problem I've seen some people also struggling. I need some
I know there are a number of posts dealing with this issue. But, I'm
I am having some trouble dealing with pick events on JUNG graphs. I have
I'm dealing with a situation where I need to bind jQuery events to a
Dealing with an employee that went over my head
Dealing with Java - which the option you prefer in the most cases -

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.