• Save
Orthogonal Architecture
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Orthogonal Architecture

on

  • 2,856 views

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

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

Statistics

Views

Total Views
2,856
Views on SlideShare
2,849
Embed Views
7

Actions

Likes
0
Downloads
0
Comments
0

4 Embeds 7

http://www.slideshare.net 2
http://static.slidesharecdn.com 2
http://www.linkedin.com 2
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 Presentation 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