Orthogonal ArchitectureA pragmatic approach<br />Sergey Shishkin<br />InterComponentWare AG<br />sergey.shishkin@icw.de<br...
This talk is supposed to be focused on...<br />
This talk is not supposed to discuss in detail...<br />
What is architecture?<br />
Architecture Open Space 2009<br />http://picasaweb.google.com/lcorneliussen/ArchitectureNETOpenSpace2009#53471092749016284...
The decisions that are hard to change<br />—Martin Fowler, PoEA<br />
Reversibility<br />
The Last Responsible Moment<br />
S.O.L.I.D.<br />
Open/Closed Principle<br />
Presentation Patterns<br />
The View<br />publicclassEditPatientView:UserControl, IEditPatientView<br />{<br />  privateEditPatientPresenter presenter...
The Presenter<br />publicclassEditPatientPresenter : Presenter<br />{<br />  publicvoidSavePatient()<br />  {<br />    if ...
The Test<br />publicclassWhen_patient_name_is_missing : InstanceContextSpecification&lt;EditPatientPresenter&gt;<br />{<br...
Dependency Injection Container<br />
Constructor Injection<br />I’m not going to call this constructor in my code<br />publicclassEditPatientPresenter<br />{<b...
Message Bus / Event Broker<br />
Message Bus<br />publicclassEditPatientPresenter<br />{<br />  ... <br />  publicvoidSavePatient()<br />  {<br />    var c...
Service Layer<br />publicclassPatientHandler : IHandler&lt;EditPatientCommand&gt;<br />{<br />  publicvoid Handle(EditPati...
Data Access Layer / O/R Mapper<br />
Querying<br />publicstaticclassPatientRepositoryExtensions<br />{<br />  publicstaticICollection&lt;Patient&gt; FindByName...
Aspect-Oriented Programming<br />
Automated<br />Tests<br />Continuous<br />Integration<br />Refactoring<br />
Resources<br />SOLID<br />http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod<br />Presentation Patterns:<br />http:/...
Q&A<br />Sergey Shishkin<br />sergey.shishkin@icw.de<br />http://shishkin.org<br />
Orthogonal Architecture
Upcoming SlideShare
Loading in...5
×

Orthogonal Architecture

2,108

Published on

"Orthogonal Architecture" talk at NRWCONF'09 on 28.08.2009 in Wuppertal

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,108
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • PROVIDE YOU SESSION CODE AND NAME AS IT WAS DEFINED BY AGENDA OWNERS.WELCOME ATTENDEES. INTRODUCE YOURSELF AND YOUR SESSION.
  • Aggregate root (as in DDD)
  • Logging, exception handling, transactions
  • PROVIDE 5 MIN BEFORE SESSION ENDS FOR Q&A.
  • Orthogonal Architecture

    1. 1. Orthogonal ArchitectureA pragmatic approach<br />Sergey Shishkin<br />InterComponentWare AG<br />sergey.shishkin@icw.de<br />http://shishkin.org<br />
    2. 2. This talk is supposed to be focused on...<br />
    3. 3. This talk is not supposed to discuss in detail...<br />
    4. 4. What is architecture?<br />
    5. 5. Architecture Open Space 2009<br />http://picasaweb.google.com/lcorneliussen/ArchitectureNETOpenSpace2009#5347109274901628498<br />
    6. 6. The decisions that are hard to change<br />—Martin Fowler, PoEA<br />
    7. 7. Reversibility<br />
    8. 8. The Last Responsible Moment<br />
    9. 9. S.O.L.I.D.<br />
    10. 10. Open/Closed Principle<br />
    11. 11. Presentation Patterns<br />
    12. 12. The View<br />publicclassEditPatientView:UserControl, IEditPatientView<br />{<br />  privateEditPatientPresenter presenter;<br /> <br />  publicEditPatientView()<br />  {<br />    PatientName = newTextBoxAdapter(patientNameTextBox);<br />  }<br /> <br />  publicIViewElementPatientName { get; set; }<br /> <br />  privatevoidOnSaveClicked(object sender, EventArgs e)<br />  {<br />    presenter.SavePatient();<br />  }<br />}<br />
    13. 13. The Presenter<br />publicclassEditPatientPresenter : Presenter<br />{<br />  publicvoidSavePatient()<br />  {<br />    if (Validate(view.PatientName.IsRequired(<br />&quot;Name is required&quot;)))<br />    {<br />      var name = view.PatientName.Text;<br /> ...<br />    }<br />  }<br /> ...<br />}<br />
    14. 14. The Test<br />publicclassWhen_patient_name_is_missing : InstanceContextSpecification&lt;EditPatientPresenter&gt;<br />{<br />  protectedoverridevoid Because()<br />  {<br />    The&lt;IEditPatientView&gt;().PatientName.Text = &quot;&quot;;<br />  }<br /> <br />  [Observation]<br />  publicvoidShould_display_error_message()<br />  {<br />    The&lt;IEditPatientView&gt;().PatientName.ErrorMessage<br /> .ShouldNotBeNull();<br />  }<br />}<br />
    15. 15. Dependency Injection Container<br />
    16. 16. Constructor Injection<br />I’m not going to call this constructor in my code<br />publicclassEditPatientPresenter<br />{<br />  privateIEditPatientView view;<br />  privateIMessageBus bus;<br /> <br />  publicEditPatientPresenter(<br />IEditPatientView view, IMessageBus bus)<br />  {<br />    this.view = view;<br />    this.bus = bus;<br />  }<br />}<br />
    17. 17. Message Bus / Event Broker<br />
    18. 18. Message Bus<br />publicclassEditPatientPresenter<br />{<br /> ... <br />  publicvoidSavePatient()<br />  {<br />   var command = newEditPatientCommand { Patient = view.Patient };<br />    bus.Send(command);<br />  }<br />}<br />
    19. 19. Service Layer<br />publicclassPatientHandler : IHandler&lt;EditPatientCommand&gt;<br />{<br />  publicvoid Handle(EditPatientCommand message)<br /> {<br />    using (vartx = newTransactionScope())<br /> {<br />      var patient = repository.Get(<br />message.PatientId);<br />patient.ChangeName(message.PatientName);<br />repository.Save(patient);<br />tx.Complete();<br />    }<br />  }<br />}<br />
    20. 20. Data Access Layer / O/R Mapper<br />
    21. 21. Querying<br />publicstaticclassPatientRepositoryExtensions<br />{<br />  publicstaticICollection&lt;Patient&gt; FindByName(<br />    thisIRepository&lt;Patient&gt; repository,<br />    stringsearchText)<br />  {<br />    returnrepository.AllEntities<br />      .Where(p =&gt; p.Name.Contains(searchText))<br />      .ToList();<br />  }<br />}<br />var collection = repository.FindByName(“Smith”);<br />
    22. 22. Aspect-Oriented Programming<br />
    23. 23. Automated<br />Tests<br />Continuous<br />Integration<br />Refactoring<br />
    24. 24. Resources<br />SOLID<br />http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod<br />Presentation Patterns:<br />http://www.jeremydmiller.com/ppatterns/<br />Clean Code Developer<br />http://clean-code-developer.de<br />Books:<br />Michael Feathers, “Working effectively with legacy code”<br />Robert C. Martin, “Clean code” and “Agile principles, patterns and practices in C#”<br />Martin Fowler, “Patterns of enterprise architecture”<br />
    25. 25. Q&A<br />Sergey Shishkin<br />sergey.shishkin@icw.de<br />http://shishkin.org<br />

    ×