Hello Avi,

I find several things in your example questionable, and basically not well 
modeled. You seem to be taking for of a technical approach to your model 
and probably not having conversations with domain experts. Does your domain 
expert really refer to VehicleAggregate, UserAggregate, and 
DriverAggregate. That's very unlikely. Would your domain expert really 
discuss telling a Driver to paint their car? Wouldn't it be the owner of 
that car who would tell a paint shop to paint their car some color?

I imagine that this is not a real domain model that you are working in 
because it seems either very contrived or at best completely technical in 
nature (not run by the business).

Best,
Vaughn


On Tuesday, June 23, 2015 at 9:44:00 AM UTC-6, Avi wrote:
>
> Hi 
> I saw this example at typesafe activator *akka-persistence-eventsourcing 
> <https://github.com/ScalaConsultants/akka-persistence-eventsourcing> and it 
> is really awesome ,but I have just a small question. *
> *in the project demonstrated we have the *VehicleAggregate 
> <https://github.com/ScalaConsultants/akka-persistence-eventsourcing/blob/master/src/main/scala/io/scalac/seed/domain/VehicleAggregate.scala>
>  
> and the userAggregate which are completely separated , but what if we had 
> another aggregate, i.e DriverAggregate (the driver that handle the 
> vehicle) which can accept command like : 
> case class PaintYourCar(color:String) extends Command 
> and should send command to the VehicleAggregate with the ChangeColor 
> command .
>
> *what is the best practice to do that ? *
>
> should the DriverAggregate have a reference in it's constructor to the 
> VehicleAggregate 
> actorRef ? which means that the DriverAggregateManager should have 
> something like 
> {
> ...
> val vehicleAggregateRef = VehicleAggregateManager 
> <https://github.com/ScalaConsultants/akka-persistence-eventsourcing/blob/master/src/main/scala/io/scalac/seed/service/VehicleAggregateManager.scala>
> .create(id) 
>   override def aggregateProps(id: String) = DriverAggregate.props(id, 
> vehicleAggregateRef)
> ...
> }
> but it doesn't feel very good .
> Please advise 
>
> Avi
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to