Arhitectura
Responsibility Driven Design
| Stereotype | Description |
|---|---|
| Information Holder | Knows things and provides information. May make calculations from the data that it holds. |
| Structurer | Knows the relationships between other objects. |
| Controller | Controls and directs the actions of other objects. Decides what other objects should do. |
| Coordinator | Reacts to events and relays the events to other objects. |
| Service Provider | Does a service for other objects upon request. |
| Interfacer | Objects that provide a means to communicate with other parts of the system, external systems or infrastructure, or end users. |
Patterns in Practice - Object Role Stereotypes
- Cum sa testezi DateTime.Now:
- http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/11/09/systemtime-versus-isystemclock-dependencies-revisited.aspx
- In esenta, se propune clasa de mai jos:
public static class SystemTime { public static Func<DateTime> Now = () => DateTime.Now; } ..... [Test] public void Should_calculate_length_of_stay_from_today_when_still_occupied() { var startDate = new DateTime(2008, 10, 1); SystemTime.Now = () => new DateTime(2008, 10, 5); var occupation = new Occupation {StartDate = startDate}; occupation.LengthOfStay().ShouldEqual(4); }
page revision: 2, last edited: 18 Nov 2008 09:08