Event Sourcing Revisit
Ah... Encapsulates Application State as derived from event/command messages. Pretty sweet.
Ah... Encapsulates Application State as derived from event/command messages. Pretty sweet.
Posted by
gutzoft
at
2:18 PM
0
comments
Labels: Event Sourcing, Martin Fowler
Was looking over event sourcing. I'm still trying to scratch my head. Will Keep plowing ahead and leave more remarks
Posted by
gutzoft
at
5:31 PM
0
comments
Labels: Event Sourcing, Martin Fowler
Presenter First: Mappers. Plain and simple. Maps events to actions/commands required on the injected objects in the presenter.
Posted by
gutzoft
at
8:10 AM
0
comments
Labels: GUI, Martin Fowler, MVP, Presenter First
Normally there are 3 data states in Presenter First design.
public class ReformatAction : CommandAction
{
public ReformatAction(ViewAggregator viewAggregator,
DomainService domainService) : base(viewAggregator, domainService){}
public override void Execute()
{
string formatModuleName = ViewAggregator.GetSelectedModuleName();
ModuleDTO moduleDTO = ViewAggregator.GetModule();
if (ViewAggregator.IsDirty)
Service.SetModule(moduleDTO);
ViewAggregator.SetModule(Service.GetModule(formatModuleName));
}
}
This code example is the wiring between the view and domain. It is a command object. It pulls the module name from the view, pulls the module, if view is dirty then save module, reload saved module to view. The formating comes from where? See what happens in the service:
public void SetModule(ModuleDTO module)
{
mModuleTable[module.GetModuleName()] = module.GetBody();
}
So we see that it is all done in the service. But you say your unformatting and saving the unformatted int the module table. Correct. Look at this piece:
public string GetBody()
{
ModuleUnformatter mu = new ModuleUnformatter(mBody);
mu.UnformatModule();
return mBody = mu.Module;
}
public string GetFormattedBody()
{
ModuleFormatter mf = new ModuleFormatter(mBody);
mf.FormatBody();
return mf.Module;
}
Ask yourself why didn’t I just transfer the formatted directly into the text box…
Next Post #3: How to utilize command pattern so that the Presenter holds no instance of Domain or View and is nothing but command messages and event messages.Post #4: Either Mocking and Unit Testing Presenter First or Event Handling.
Posted by
gutzoft
at
8:42 PM
0
comments
Labels: Design Pattern, DSL, GUI, Martin Fowler, Presenter First
Posted by
gutzoft
at
4:59 PM
0
comments
Labels: DSL, Martin Fowler, Reflection C#