Skip to content

Instantly share code, notes, and snippets.

@kkozmic
Created November 30, 2009 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkozmic/245597 to your computer and use it in GitHub Desktop.
Save kkozmic/245597 to your computer and use it in GitHub Desktop.
public class TestClient
{
// no need for additional methods, properties, or delegates
// All internal state needs to be declared as protected proterties
protected virtual Address Address { get; set; }
// Domain behavior does not have to be virtual, nor return anything
public void ClientMoves(Address address)
{
// branch
if(address.IsOnMars)
{
//multiple published events
ClientMovedToMars(address);
ClientNoLongerLivesOnEarth(address);
}
else
{
ClientMoved(address);
}
}
protected virtual ClientMovedEvent ClientMoved(Address address)
{
return new ClientMovedEvent(address);
}
protected virtual ClientNoLongerLivesOnEarthEvent ClientNoLongerLivesOnEarth(Address address)
{
return new ClientNoLongerLivesOnEarthEvent(address);
}
protected virtual ClientMovedToMarsEvent ClientMovedToMars(Address address)
{
return new ClientMovedToMarsEvent(address);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment