Camelia, the Perl 6 bug

IRC log for #cqrs-perl6, 2012-09-19

| Channels | #cqrs-perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
05:53 BooK I was thinking about accessors...
05:55 BooK accessors usually do an individual change on an object (like $user->set_name), but in this model, how does that look?
07:28 BooK regarding "distributed" systems, I was thinking about the following:
07:29 BooK so you have a "snapshot" of the aggregates copied to some other system, where commands are run, they generate local events, which are applied
07:30 BooK when comes the time to sync with the master, it's the commands that should be run again. some might fail, thus requiring conflict resolution commands, and in the end, a new set of events is generated on the master, producing the merged state
07:31 BooK those events might be interleaved with other events (created in parallel), or maybe doing the sync would require locking of part of the aggregates
08:00 masak BooK: re accessors: commands are UI-centric, as we talked about yesterday. they sometimes do correspond to individual setters, but not always. this way of building stuff is often applied when we can do better than just CRUD operations and $obj->set_X is somewhat of a warning bell that we're just doing "update" operations.
08:04 masak BooK: re merging: yes, I also think one wants to do merging of commands in an occasionally connected system. it's like commands capture the "intent" of an operation, and if one can extract this intent from command + state, one can reconstruct a new command later with the "same" intent. see also https://en.wikipedia.org/wik​i/Operational_transformation
08:05 * masak finds the latter absolutely fascinating, by the way
08:17 BooK ah ok, I was missing the UI-centricness of commands
08:18 BooK so we don't need commands for update operations?
08:18 BooK or rather, what about a UI centered around CRUD operations ?
10:28 masak if your UI is CRUD-centered (and you don't plan on changing that), it's questionable whether you need commands and events.
10:35 BooK I think the whole application is CRUD centered, in a way
10:35 BooK everyone updates tiny bits of info here and there, and the result is made available to everyone
10:36 BooK I was thinking about Act
10:36 BooK conference management is mostly sharing information that different people can update
10:39 masak yeah, I had a feeling you were thinking about Act. :)
10:40 masak I'm not sure I agree you can't do more composed operations than just the CRUD operations, though.
10:43 BooK maybe there are, but the vast majority is basically users registering, speakers updating their talks, orgas approving talks or updating the site or schedule
10:44 BooK which also makes the distributed side of it much easier, as conflicts are unlikely, and can usually be resolved by applying the latest change
10:46 masak aye.
10:47 masak though as the programmer you have to anticipate and adequately handle all possible conflicts, too.
10:47 masak they often get a disproportionate amount of attention in the code.
10:55 BooK conflicts will only happen at sync time
10:55 BooK but they won't be detected if just applying a set changes on top of the current state
11:16 BooK to detect conflicts, we probably need changesets, and to keep track of the last synchronisation point
11:16 BooK which brings us back to commands/events, I suppose
12:18 masak a command is conceptually more than a changeset.
12:19 masak a command captures the *intent* of the user. the intent is a wider concept than just the sum of individual changes.
12:19 masak two separate intents may translate down to the exact same change in the model. example: CustomerMoved vs CustomerCorrectedAddress.
12:34 BooK right
13:19 masak if you ask me, this is the bit win during modeling: that you're reifying the *intents* both within the model and from the viewpoint of the user.
13:20 masak we've done a few domain modeling sessions now, jnthn and I, by starting by talking purely about the events involved. no data model, just the events. it feels very, very right to do it that way.
13:38 BooK how does a domain modeling session work?
13:39 BooK events or commands?
13:46 masak we tend to focus on the events. sometimes we bring in commands if we suspect they will differ greatly.
13:47 masak but the big difference from "traditional" development is not worrying about the data model at all. we never worry how tables are going to foreign key each other, or how to represent the insides of an aggregate at this stage.
13:48 BooK it would be very interesting to try this on our project
13:48 masak when we did the hex project, we went the whole day without talking about data structures. when it was time to make the first test pass, we both went "oh right, the data!". it was an interesting shift in focus.
13:48 BooK but dams is afraid that it would take much longer that just doing what he's used to with DBIC and Dancer
13:48 masak there is that risk. especially the first time, as you're still internalizing concepts.
13:49 masak we found that the way of developing didn't really "stick" until we acutally sat down and made things work in our own project. that's when it ceases to be a set of abstract concepts.
13:50 BooK now we need to invest some funds in consulting from you guys :-)
13:51 dams plop
13:55 dams we'll try it for the first simple version
13:55 dams $
13:57 BooK I don't think using this prevents using DBIC to update the actual datastore
13:57 masak right.
13:58 masak I think I speak for both jnthn and our bosses when I say that we would be happy to help with consulting.
13:59 BooK I thought you were your own bosses :-)
14:00 masak not in any literal sense, no :)
14:01 masak but we're employees #001 and #002, which give some freedom to shape the company in our image.
14:02 BooK so, how long would a domain modeling session take, over irc?
14:04 masak dunno. we tend to do them over beer :)
14:04 masak last one we did took about an hour. but the domain was fairly small.
14:04 BooK so we can pay you in beer?
14:04 masak I'll have to clear that with my boss :P

| Channels | #cqrs-perl6 index | Today | | Search | Google Search | Plain-Text | summary