Search the web
Sign In
New User? Sign Up
domaindrivendesign · Domain-Driven Design
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Presentation Models   Message List  
Reply | Forward Message #13834 of 16054 |
RE: [domaindrivendesign] Re: Presentation Models

Jesper,

 

I think you've taken things a bit too far.

 

The command side of things behaves just as any standard ORM app would. No need to use the query side at all when processing commands.

 

-- Udi Dahan

 

From: domaindrivendesign@yahoogroups.com [mailto:domaindrivendesign@yahoogroups.com] On Behalf Of Jesper De Temmerman
Sent: Tuesday, July 14, 2009 5:28 PM
To: domaindrivendesign@yahoogroups.com
Subject: RE: [domaindrivendesign] Re: Presentation Models

 




Thank you Michael and Udi, this makes things a little clearer.

Assuming that we take the 'domain object contains internal state'-approach, how would this state get into the domain object? The query side contains all the code to fetch state from persistent storage and apply the events, so we could call that when creating a domain object to get the state.

At the same time, something tells me that this is not a good way to work because it mixes the command and query bounded contexts. With the only advantage being that we can call existing code the added complexity is probably not worth the cost.

When firing events from the domain objects I assume that there will be a class that intercepts these events, persists them and routes them to the query repositories for 'processing' to update the query-data?

> Jesper,
>
>
>
> While the query side exposes state, it's not that the command side doesn't
> have its own state.
>
>
>
> So, to this:
>
>
>
> "It does not make sense to actually set the address in the customer object
> because it should not contain the state"
>
>
>
> It actual makes perfect sense (unless you're doing the commands-as-state
> pattern that Greg is talking about).
>
>
>
> -- Udi Dahan



Tue Jul 14, 2009 9:32 pm

udidahan7
Offline Offline
Send Email Send Email

Attachment
image001.jpg
Type:
image/jpeg
Attachment
image002.jpg
Type:
image/jpeg
Forward
Message #13834 of 16054 |
Expand Messages Author Sort by Date

Thank you Michael and Udi, this makes things a little clearer. Assuming that we take the 'domain object contains internal state'-approach, how would this state...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 14, 2009
2:28 pm

Jesper, I think you've taken things a bit too far. The command side of things behaves just as any standard ORM app would. No need to use the query side at all...
Udi Dahan
udidahan7
Offline Send Email
Jul 14, 2009
9:33 pm

Hi, "It does not make sense to actually set the address in the customer object because it should not contain the state" Why. Well only if you don't have a...
Nuno Lopes
nbplopes
Offline Send Email
Jul 14, 2009
3:08 pm

"I said the difference is". Should have said one of the differences has there are more. Especially the purpose is different, but from the point of view of...
Nuno Lopes
nbplopes
Offline Send Email
Jul 14, 2009
3:13 pm

I also wrote: "One cannot talk about Event Sourcing with a source IMHO." Should have been: "One cannot talk about Event Sourcing WITHOUT a source IMHO." What I...
Nuno Lopes
nbplopes
Offline Send Email
Jul 14, 2009
3:23 pm

So, incorporating these changes this would mean we're doing the following ChangeUserEmailAddress-command is determined as being 'valid to use' for the current...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 16, 2009
7:45 am

In your example, does the domain object also publish each event as it occurs or does your domain service republish them after saving them to the repository? I...
Lee Henson
leemhenson
Offline Send Email
Jul 16, 2009
8:43 am

Hi Jesper, Your steps seem quite complicated, but maybe I'm missing something. How about this: - Command picked up by command handler (happy with everything...
Michael Hart
michaelhartau
Online Now Send Email
Jul 16, 2009
9:49 am

The purpose of the initial UserEmailAddressChange-event was to give the domain object something to respond to that would work for both actual changes and...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 16, 2009
11:48 am

Seems to me that the additional event you introduced is a solution for a specific problem rather than the default approach. So in general what Jesper wrote is...
Evgeny Shapiro
evgshapiro
Offline Send Email
Jul 16, 2009
11:54 am

Hi Jesper your steps seam quite similar to mine. The problem I'm having in my case is related to: *"*Everything that should only occur when the command is...
Nuno Lopes
nbplopes
Offline Send Email
Jul 16, 2009
4:32 pm

Humm it would work if events where played against a domain model retrofited to the same instant when the event occurred and was processed. Probably a snapshot....
Nuno Lopes
nbplopes
Offline Send Email
Jul 16, 2009
4:39 pm

Events are state changes... When replaying you will by definition be in the same state as when the event originally happened. You never take actions on the...
Greg Young
gumboismadeo...
Offline Send Email
Jul 16, 2009
4:51 pm

I wrote: "I think we are negleting that selection is also part of the business logic." Here I jumped scope. The selection I was refering is at the first run of...
Nuno Lopes
nbplopes
Offline Send Email
Jul 16, 2009
9:50 pm

Shouldnt the event be carrying forward the *result* of that computation? or were you planning on recalculating it everywhere? Why is this an issue with...
Greg Young
gumboismadeo...
Offline Send Email
Jul 17, 2009
1:55 am

Clearly my english skills are not that good sorry. I too when I read it the second time can see that it can be interpreted in all sorts of ways. I'll try to ve...
Nuno Lopes
nbplopes
Offline Send Email
Jul 17, 2009
9:57 am

Greg, Let's deal with each context separately: 1. Replaying events for the purpose of bringing another system (or newer version of the same system) to a...
Udi Dahan
udidahan7
Offline Send Email
Jul 17, 2009
1:15 pm

... to > happen (or that has been requested to happen), like a command. It's a > particular event that has meaning in your domain (eg, to steal a tired >...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 20, 2009
9:33 am

... Interesting - I had never thought of them as an explicit request before - always as something that had already happened that someone may be interested in....
Michael Hart
michaelhartau
Online Now Send Email
Jul 20, 2009
10:32 am

command[0..1:1]command-handler[1:1]domain-event[1:1]domain-handler[1:1]domain-state-change-event They all seam similar when looking at their data, but their...
Nuno Lopes
nbplopes
Offline Send Email
Jul 20, 2009
11:13 am

  ... reaction to a lot of different domain events, and at the same time a domain event can come from a lot of different commands. But in most systems you...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 20, 2009
12:17 pm

... been > espousing - they look a lot more like commands and he's clearly > storing the event first, and then reading it to process it (which is > more what...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 20, 2009
12:10 pm

... Ah, I think you misunderstood me there, not sure where the compensating actions came from - I was talking about the command being rejected because it...
Michael Hart
michaelhartau
Online Now Send Email
Jul 20, 2009
1:24 pm

Jesper I begin to see the mapping between your model and michael's model. To sum up. Your model : Command -> CommandHandler -> DomainEvent -> DomainHanlder ->...
jeremie.chassaing
jeremie.chas...
Offline Send Email
Jul 20, 2009
1:33 pm

It's definitely Greg's model :-) Or at least my (and possibly others') understanding of it. Also, I'm quite happy with side effects happening in entities...
Michael Hart
michaelhartau
Online Now Send Email
Jul 20, 2009
1:41 pm

... Oh just reread this, I meant that in the sense that it's not "Michael's Model" :-) Not in the sense that this is definitely how Greg is doing things -...
Michael Hart
michaelhartau
Online Now Send Email
Jul 20, 2009
1:54 pm

... Haha, that's why I put the ? in the () ! It was also my understanding of Greg's model so far....
jeremie.chassaing
jeremie.chas...
Offline Send Email
Jul 20, 2009
2:07 pm

... during > command processing (even with external services if need be). For me, > the processing of a command (or you could just think of it as an > action...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 20, 2009
2:13 pm

... Huh-wha? State-change events listening to side-effect functions? I'm a little lost. I was just saying that I'm happy with causing side effects during the ...
Michael Hart
michaelhartau
Online Now Send Email
Jul 20, 2009
2:32 pm

... (to >> clarify: not the bounded context but the situation that caused the >> change)? > > Huh-wha? State-change events listening to side-effect functions?...
Jesper De Temmerman
jesper.detem...
Offline Send Email
Jul 20, 2009
3:02 pm
 First  |  |  Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help