Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
Add Comment
Please, Sign In to add comment