O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Bare-Bones Software Architecture

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Carregando em…3
×

Confira estes a seguir

1 de 107 Anúncio

Bare-Bones Software Architecture

Baixar para ler offline

These are my slides from the Bare-Bones Software Architecture course at XP Days Ukraine 2012. The workshop outlines a quick workshop-oriented process for initiating software projects

These are my slides from the Bare-Bones Software Architecture course at XP Days Ukraine 2012. The workshop outlines a quick workshop-oriented process for initiating software projects

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Semelhante a Bare-Bones Software Architecture (20)

Mais de Johannes Brodwall (20)

Anúncio

Bare-Bones Software Architecture

  1. 1. Agile Architecture XP Days 2012 Johannes Brodwall, Chief scientist Exilesoft Global
  2. 2. What is an architect? From greek Arkhi-Tecton Tecton: Builder Arkhi: Chief. Like “Arch angel” Or “Arch villain”
  3. 3. What is an architect? “Chief builder”
  4. 4. What is an architect? (Exilesoft definition)
  5. 5. A solution architect is someone who understands the problem of the customer and uncovers and communicates a feasible solution
  6. 6. A solution architect is someone who understands the customer’s problem (including contraints, context, domain knowledge) and uncovers (though a team effort) and communicates (with credibility) a feasible solution (primarily, but not exclusively technical)
  7. 7. Uncover problem vision, stakeholders, usage flow Describe problem context and domain model Describe solution deployment, implementation model
  8. 8. • Describing architecture • Simplifying architecture • Delivering architecture • Delivering software
  9. 9. Part I:
  10. 10. Describing architecture
  11. 11. • Understanding problem • Uncovering solution • Communicating architecture
  12. 12. Understanding the problem
  13. 13. (Tool time)
  14. 14. For some stakeholder Who has a responsibility The Bare-bones architecture workshop Is a type of activity Which gives a capability. Unlike most relevant alternative This has a distinguishing attribute.
  15. 15. For __________________ Who ________________ The _________________ Is a _________________ Which ________________. Unlike ______________________ This _______________________.
  16. 16. Participant? ??? ??? Who are they? Description Description What do they do? Duties Duties Why do they care? Values Values
  17. 17. Example «Smidig» conference application
  18. 18. Example vision statement
  19. 19. For Agile practitioners Who need to expand on their experience and network The Smidig conference Is a networking event Which connects you with other Agile practitioners. Unlike traditional conferences This presents the experience of many people through lightning talks.
  20. 20. For Conference organizers Who want to organize a good conference The Smidig conference app Is a web application Which eliminates unnecessary work. Unlike commercial conference apps This is optimized for the large number of talks we have and allows us to make changes fast.
  21. 21. Example stakeholders
  22. 22. Speaker Attendee Organizer Description Description Description • Experienced • Knows about agile • Volunteer • New speaker • Works in project • Works in evenings • Passionate • Norwegian • Has network Duties Duties Duties • Register talk • Pay for conference • Select talks • Upload slide • Get approval to go • Follow up • Give talk payments Values Values Values • Easy selection process • Constructive • Easy registration • Good information feedback on talk overview • Easy CfP • Never lose a participant • Fast answer • Financial transparency
  23. 23. Sponsor Description • Busy • Manager • Not very interested Duties • Provide logo • Pay sponsorship Values • Informal communication • Easy evaluation
  24. 24. Example usage flow
  25. 25. Attendance 1. Agile project practitioner wants to learn 2. Attendee goes to Smidig website 3. Attendee registers 4. Attendee pays using Paypal 5. Attendee receives confirmation mail 6. Organizer can see the registration 7. Organizer sends reminder email to attendee to come 8. Organizer prints badges for attendees with Print Company 9. Attendee shows up at Smidig and has an excellent time
  26. 26. Speaker 1. Agile experts wants to share knowledge 2. Potential speaker goes to Smidig website 3. Potential speaker registers personal info 4. Potential speaker registers talk 5. Potential speaker receives registration confirmation email 6. Organizer sees registered talk and can market speaking opportunities 7. Organizer accepts talk for confence 8. Speaker receives acceptance email – Alternative: Speaker withdraws talk – organizer updates the talk and selects another 9. Organizer prints badges for speakers 10. Speaker shows up at Smidig and gives talk
  27. 27. /Understanding the problem
  28. 28. Uncovering a solution
  29. 29. Example context model
  30. 30. Participant Speaker Organizer Paypal Smidig2011.no Printing company
  31. 31. Example domain model
  32. 32. User • Name Registration • Email • Ticket type • Price • Company • Paid amount • Phone • Paypal ref • Password • Payment date • Invoice address [optional] • Accepts email? * Comment * • Title Speaker • Text • Created date * * Talk Period • Title • Description • Stage • Tags[] * • Title • Slide file • Time of day • Status : • Day {pending, accept, rejec t} • Email_sent • Position
  33. 33. Example deployment model
  34. 34. Web user Developer html/http git push git push git pull Smidig- conference http Paypal github git.heroku (Rails) smtp Heroku Smtp.dreamhost.com smidigdb PostgreSQL
  35. 35. Example implementation diagram
  36. 36. 1. Find controller Router 2. Dispatch action 3. Find model Controller Model class 4. Manipulate model Database Model 5.? Save model 6. Render model with view template View template View template
  37. 37. POST /users/<id> Router 1. Find UserController 2. update(id) /app/controllers 3. find(id) /app/models 4. SELECT … UsersController FROM users User class 5. update_attr(params) Database app/models 6. save User 7. UPDATE 8. Redirect /users/<id> users SET …
  38. 38. GET /users/<id> Router 1. Find UsersController 2. show(id) /app/controllers 3. find(id) /app/models 4. SELECT … UsersController User class FROM users Database User 5. Render /app/views/users 6. Get attributes show.html.erb
  39. 39. Alternative
  40. 40. Browser Smidig2012.no Paypal.com 1. POST /users Save user info 2. Redirect to paypal with return_url and notify_url 3. Perform payment 4. POST /payment_notifications Update user info 5. Redirect to return_url 5. GET /user/<id> Show user info
  41. 41. /Uncovering a solution
  42. 42. Communicating a solution
  43. 43. Vision Stakeholders Usage flow Context Domain model Deployment Implementation
  44. 44. Does the architect have to do this herself?
  45. 45. Team effort
  46. 46. /Communicating a solution
  47. 47. /Describing architecture
  48. 48. Part II:
  49. 49. Finding the requirements
  50. 50. I need a volunteer
  51. 51. For some stakeholder Who has a responsibilty The system name Is a type of system Which gives a capability. Unlike most relevant alternative This has a distinguishing attribute.
  52. 52. Participant? ??? ??? Who are they? Description Description What do they do? Duties Duties What do they care Values Values about?
  53. 53. …. 1. Something happens in the real world 2. The event is communicated to the system 3. The system does something 4. Someone does something with the system 5. … 6. … 7. … 8. … 9. … 10. Some goal is achieved
  54. 54. /Finding requirements
  55. 55. Part III:
  56. 56. Describe architecture
  57. 57. Frugalflights.com 1. A customer wants cheap vacations 2. The customer signs up for daily or weekly notifications of special flight offers 3. Periodically the System checks which customers should get notifications 4. The System checks for offers that matches the customer’s travel preference by looking up flights with the travel provider system 5. The System notifies customer of any matching offers via SMS • Variation: The System notifies customer of any matching offers via email 6. The customer accepts the offer via SMS 1. Variation: The customer accepts the offer on the system website 7. The System books the tickets on behalf of the customer 8. The system confirms the booking by sending an SMS to the customer 9. The customer can at any point see their active offers and accepted offers on the system website 10. The customer enjoys a cheap vacation!
  58. 58. User User Who are they Who are they • … • … What do they do? What do they do? • … • … What do they value? What do they value? • … • … User User Who are they Who are they • … • … What do they do? What do they do? • … • … What do they value? What do they value? • … • …
  59. 59. Example context model
  60. 60. What actors did you mention in scenario?
  61. 61. Context: Frugalflights.com 1. A customer wants cheap vacations 2. The customer signs up for daily or weekly notifications of special flight offers (where?) 3. Periodically the System checks which customers should get notifications 4. The System checks for offers that matches the customer’s travel preference by looking up flights with the travel provider system 5. The System notifies customer of any matching offers via SMS • Variation: The System notifies customer of any matching offers via email 6. The customer accepts the offer via SMS 1. Variation: The customer accepts the offer on the system website 7. The System books the tickets on behalf of the customer (where?) 8. The system confirms the booking by sending an SMS to the customer 9. The customer can at any point see their active offers and accepted offers on the system website 10. The customer enjoys a cheap vacation!
  62. 62. Domain: Frugalflights.com 1. A customer wants cheap vacations 2. The customer signs up (?) for daily or weekly notifications of special flight offers (=> “create a subscription”?) 3. Periodically the System checks which customers should get notifications 4. The System checks for offers that matches the customer’s travel preference by looking up flights with the travel provider system 5. The System notifies customer of any matching offers via SMS (=> “sends notification”?) • Variation: The System notifies customer of any matching offers via email 6. The customer accepts the offer via SMS (=> “send acceptance”) 1. Variation: The customer accepts the offer on the system website 7. The System books the tickets on behalf of the customer 8. The system confirms the booking by sending an SMS to the customer (=> “sends confirmation”?) 9. The customer can at any point see their active offers and accepted offers on the system website 10. The customer enjoys a cheap vacation!
  63. 63. Example domain model
  64. 64. What concepts did you mention in scenario?
  65. 65. Example deployment model
  66. 66. Which servers are involved in production?
  67. 67. Example implementation diagram
  68. 68. How does the code work?
  69. 69. Statnett electricity reserves 1. Grid operator want to maintain balance of electric production and consumption 2. Power producer sends unused capacity (reserves) per hour for each power plant to LARM using EDIFACT via Sterling Integrator – Detail: The capacity “line” has a price – Detail: Each plant may have several capacities at different prices – Detail: Capacity may be to increase or to decrease production 3. A spike occurs in the consumption or production 4. Grid operator sees list of available reserves per power plant 1. Alternative: Operator filters the list by grid market area 5. Grid operator selects a reserve to regulate for spike 6. Grid operator enters power usage on the regulation 1. Alternative: The system verifies that regulation is valid 7. Grid operator communicates the regulation to producer’s operation center using phone 1. Future: The system sends the regulation to the producer as XML/http 8. Balance is restored 9. At end of hour, system sends usage to pricing system (NOIS) (XML/http) via Sterling Integrator 10. Some time later, pricing system sends price for usage via SI 11. System sends price capacity usage to accounting system via SI 12. Accounting system pays producer for usage
  70. 70. /Describe architecture
  71. 71. What surprised you? What did you learn? Your plan to change how you work?
  72. 72. Conclusion:
  73. 73. Tomorrow: Make your system shine!
  74. 74. Thank you jbr@exilesoft.com http://johannesbrodwall.com http://exilesoft.com http://twitter.com/jhannes • Vision • Stakeholders • Usage flows
  75. 75. • Lasagna architecture • Feature oriented architecture • Deployment constraints
  76. 76. Lasagna architecture
  77. 77. Person- Person- Person- PersonDao Controller Service Repository Person- Person- Person- PersonDao Controller- Repository ServiceImpl Impl Impl Impl Session- Factory
  78. 78. Controllers Services Managers Workers Repositories
  79. 79. Controllers DTO Services Mapping Domain Managers Workers Repositories
  80. 80. Customer Invoice Order Product
  81. 81. Tidying up art (Ursus Wehrli)
  82. 82. Feature oriented architecture
  83. 83. Coherence • What changes together lives together
  84. 84. Tolerance • What should be different can be different
  85. 85. Meaning • What is central in domain is central in code
  86. 86. Your thinking is contrained by technology fashion:
  87. 87. Controllers DTO Services Mapping Domain Managers Workers Repositories
  88. 88. Your solution is constrained by deployment
  89. 89. Web user Browser JSON/http Controller DTO? Web Application Consumer DTO SOAP Service DTO Web Service Database
  90. 90. Web user html/http Controller Web Application DAO Database
  91. 91. Web user html/http Reverse proxy html/http Controller Web Application DAO Database
  92. 92. Web user Browser JSON/http DTO? Controller Web Application DAO Database
  93. 93. Web user Controller Rich client Consumer DTO Web service Service DTO Web Application Database
  94. 94. Web user Controller Rich client DTO Objects over http DTO Web Application Database
  95. 95. Web user External client Browser JSON/http Controller DTO? Web Application Consumer DTO SOAP Service DTO Web Service DAO Database
  96. 96. Web user External client Browser JSON/http Service Controller DTO Web Application DAO Database

×