Created
November 30, 2009 17:59
-
-
Save kkozmic/245597 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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