Business Natural Languages Development In Ruby

1,114 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,114
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Business Natural Languages Development In Ruby

  1. 1. Business Natural Language (BNL) Jay Fields http://jayfields.com
  2. 2. What?
  3. 3. Domain Specific Language (DSL)
  4. 4. Why?
  5. 5. Developer Developer Business QA
  6. 6. Developer Developer Business QA
  7. 7. Developer Developer Business QA
  8. 8. Developer Developer Business QA
  9. 9. Developer Developer Business QA
  10. 10. Developer Developer Business QA
  11. 11. Developer DSL Business
  12. 12. Why?
  13. 13. Benefits
  14. 14. Benefits Managers -Improve efficiency by distributing workload
  15. 15. Benefits
  16. 16. Benefits Developers -Technical Decisions not Business Details
  17. 17. Benefits
  18. 18. Benefits Business -Time to market
  19. 19. BNL == DSL
  20. 20. BNL == DSL #=> false
  21. 21. Domain Specific Languages
  22. 22. Domain Specific Languages YACC Excel Macros Ruby on Rails Cobol Rake XML etc...
  23. 23. So?
  24. 24. Concise or Verbose?
  25. 25. Concise or Verbose? Who’s the author?
  26. 26. “DSL” is too general
  27. 27. BNL < DSL
  28. 28. BNL < DSL #=> true
  29. 29. The Difference
  30. 30. The Difference • Natural Language
  31. 31. The Difference • Natural Language • Written by the Business - subject matter experts
  32. 32. Today
  33. 33. Specification Award 2 points if the fare class is A, C, D, J, Z
  34. 34. Code account.award 2.points if [A, C, D, J, Z].include? fare
  35. 35. Specification Award 2 points if the fare class is A, C, D, J, Z
  36. 36. Code Award 2 points if the fare class is A, C, D, J, Z
  37. 37. How?
  38. 38. External
  39. 39. Award 2 points if the fare class is A, C, D, J, Z
  40. 40. Award 2 points if the fare class is A, C, D, J, Z account.award 2.points if [A, C, D, J, Z].include? fare
  41. 41. Award 2 points if the fare class is A, C, D, J, Z
  42. 42. Award 2 points if the fare class is A, C, D, J, Z •account.instance_eval
  43. 43. Award 2 points if the fare class is A, C, D, J, Z •rule.gsub /^A/, “a”
  44. 44. award 2 points if the fare class is A, C, D, J, Z •rule.gsub /^A/, “a”
  45. 45. award 2 points if the fare class is A, C, D, J, Z • rule.gsub /d /, ‘1.’
  46. 46. award 2.points if the fare class is A, C, D, J, Z • rule.gsub /d /, ‘1.’
  47. 47. award 2.points if the fare class is A, C, D, J, Z •rule.gsub /class/, ‘’
  48. 48. award 2.points if the fare is A, C, D, J, Z •rule.gsub /class/, ‘’
  49. 49. award 2.points if the fare is A, C, D, J, Z •rule.gsub /([A-Z, ]+)/, '[1]'
  50. 50. award 2.points if the fare is [ A, C, D, J, Z ] •rule.gsub /([A-Z, ]+)/, '[1]'
  51. 51. award 2.points if the fare is [ A, C, D, J, Z ] •rule.gsub /if the ([a-z] +) is([.+])/, 'if 2.include? 1'
  52. 52. award 2.points if [ A, C, D, J, Z].include? fare •rule.gsub /if the ([a-z] +) is([.+])/, 'if 2.include? 1'
  53. 53. award 2.points if [ A, C, D, J, Z].include? fare
  54. 54. award 2.points if [ A, C, D, J, Z].include? fare account.award 2.points if [A, C, D, J, Z].include? fare
  55. 55. award 2.points if [ A, C, D, J, Z].include? fare account.award 2.points if [A, C, D, J, Z].include? fare Specification == Code
  56. 56. Code, Specification,
  57. 57. Code, Specification, and Documentation
  58. 58. Readable Documentation
  59. 59. Descriptive And Maintainable Phrases (DAMP)
  60. 60. Maintainable
  61. 61. Readable by any subject matter expert
  62. 62. Who is the user?
  63. 63. Training
  64. 64. Training
  65. 65. Statistics
  66. 66. Developer Developer Business QA
  67. 67. Developer Developer Business QA
  68. 68. Developer Developer Business QA
  69. 69. Developer BNL Business
  70. 70. quot;A change that used to take 3-4 days now takes about 10 minutes.quot;
  71. 71. Example
  72. 72. First Class / Business Class / A, C, D, J, R, Z 2 BusinessFirst Full Fare Y, H 2 Economy Class K, M, N, B, Economy Class 1 O,V, U
  73. 73. Business Logic
  74. 74. BNL?
  75. 75. No
  76. 76. No
  77. 77. BNL When the fare class is A, C, D, J, R, or Z then award 2 points
  78. 78. When the fare class is A, C, D, J, R, or Z then award 2 points
  79. 79. When the fare class is A, C, D, J, R, or Z then award 2 points rule.gsub /the fare class is /, ‘’ When A, C, D, J, R, or Z then award 2 points
  80. 80. When A, C, D, J, R, or Z then award 2 points
  81. 81. When A, C, D, J, R, or Z then award 2 points rule.gsub /^W/, ‘w’ when A, C, D, J, R, or Z then award 2 points
  82. 82. when A, C, D, J, R, or Z then award 2 points
  83. 83. when A, C, D, J, R, or Z then award 2 points rule.gsub / or /, ‘ ’ when A, C, D, J, R, Z then award 2 points
  84. 84. when A, C, D, J, R, Z then award 2 points
  85. 85. when A, C, D, J, R, Z then award 2 points rule.gsub /award /, ‘’ when A, C, D, J, R, Z then 2 points
  86. 86. when A, C, D, J, R, Z then 2 points
  87. 87. when A, C, D, J, R, Z then 2 points rule.gsub / points/, ‘’ when A, C, D, J, R, Z then 2
  88. 88. when A, C, D, J, R, Z then 2
  89. 89. when A, C, D, J, R, Z then 2 rule.gsub /([A-Z])/, 'FareClass::1'
  90. 90. when FareClass::A, FareClass::C, FareClass::D, FareClass::J, FareClass::R, FareClass::Z then 2
  91. 91. when FareClass::A, FareClass::C, FareClass::D, FareClass::J, FareClass::R, FareClass::Z then 2
  92. 92. Getting it to execute
  93. 93. BusinessLogic.rules returns the rules from the DB
  94. 94. Developer Business
  95. 95. Developer Business
  96. 96. Approver Developer Business Production
  97. 97. Deployment?
  98. 98. Programmers: Are you out of a job?
  99. 99. Absolutely Not
  100. 100. Absolutely Not • Language Workbench
  101. 101. Absolutely Not •Language Workbench •Syntax Checking
  102. 102. Absolutely Not •Language Workbench •Syntax Checking •Test Environment
  103. 103. Absolutely Not •Language Workbench •Syntax Checking •Test Environment •Approval Workflow
  104. 104. Syntax Checking
  105. 105. Syntax Checking When the fare class is A, C, D, J, R, or Z then award 2 points
  106. 106. Syntax Checking
  107. 107. Syntax Checking When the far Did you mean ‘fare class’?
  108. 108. Commercial Language Workbenches
  109. 109. Commercial Language Workbenches MPS - JetBrains Intentional
  110. 110. Another Example
  111. 111. Employee Compensation
  112. 112. Corporate Datastore
  113. 113. Example Employees
  114. 114. Demo
  115. 115. Bad Choice?
  116. 116. Author?
  117. 117. Author? Change Frequency
  118. 118. What deserves a BNL?
  119. 119. Ruby?
  120. 120. BNL vs Rules Engines
  121. 121. More Information bnl.jayfields.com
  122. 122. Questions bnl@jayfields.com Jay Fields http://www.jayfields.com

×