Your SlideShare is downloading. ×
Orthogonal Architecture
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Orthogonal Architecture

2,004

Published on

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

"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,004
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
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.
  • Transcript

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

    ×