Niclas Hedhman wrote:
On Tue, Jul 28, 2009 at 4:36 PM, Rickard Öberg<[email protected]> wrote:
But, since the Entity composite extends the state interface the event method
is trivially available during replay. The only "hack" is to do the abstract
thing so the mixin doesn't have to implement the state methods
(properties+associations). Reasonably ok I think. I also don't like that I
have to put @Optional on the method. Would probably be better to send in
some kind of default event instead of null when running the command.

Uhhh, so I have misunderstood you in the past??

I would expected to see;

public OrganizationalUnit createOrganizationalUnit(String name)
{
    String id = idGenerator.generate(OrganizationalUnitEntity.class);
    OuCreatedEvent event = new OuCreatedEvent( id );
    OrganizationalUnitEntity ou = state.organizationalUnitCreated( event );
    :

I think you have changed this pattern, and I suspect for a reason, but
failed to explain why...

I don't want to create a class "OuCreatedEvent", because that will lead to explosion of classes (=1 per method, pretty much). So instead I am using the method as the event identifier, and then try to either reuse valuecomposites used as single parameter, or use parameters but with names if possible.

I've done a LOT of changes to the event/command thinking just the past 24 hours, so it's a bit hard to keep track of all the changes.

/Rickard


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to