Permalink
Browse files

Notes

  • Loading branch information...
1 parent 739aa89 commit 0c78299e953a930ac9af30d35a189528cdc22d7a @r00k committed Aug 14, 2012
Showing with 23 additions and 4 deletions.
  1. +1 −0 lib/failure_notifier.rb
  2. +9 −0 lib/parameter_coupling_example.rb
  3. +4 −4 notes.txt
  4. +9 −0 parameter_coupling_example.rb
View
@@ -0,0 +1,9 @@
+class FailureNotifier
+ def notify_user_of_failure
+ print_to_console(failure)
+ end
+
+ def print_to_console(failure)
+ console.print(failure.to_sentence)
+ end
+end
View
@@ -3,7 +3,7 @@ Intro - 1 min
* tell, don't ask
* this is pairing
-data_clump.rb - 24 minutes, spend less time on coupling, 3-21
+data_clump.rb - 24 minutes, spend less time on coupling, 3-21 (18.5)
* I have specs
* roughly a B
* move temp to query for orders_within_range
@@ -21,7 +21,7 @@ data_clump.rb - 24 minutes, spend less time on coupling, 3-21
* create private Order#total_sales
* change to inject(&:+)
-null_object.rb - 6 m, 22-28
+null_object.rb - 6 m, 22-28; 19-24 5m
* breaking the core ideas of polymorphism
* rather than just sending a msg, we're asking and then reacting
* would rather just send a message
@@ -31,9 +31,9 @@ null_object.rb - 6 m, 22-28
deco.rb - 11:30m
* change view to @user.welcome_message
- * make this part clearer
+ * add method to user, but it's bad
+ * create AdminPresenter and NormalUserPresenter
* create transparent decorators
- * method:
* redefine welcome_message
* wins:
* logic is separated
@@ -0,0 +1,9 @@
+class FailureNotifier
+ def notify_user_of_failure
+ print_to_console(failure)
+ end
+
+ def print_to_console(failure)
+ @console.print(failure.to_sentence)
+ end
+end

0 comments on commit 0c78299

Please sign in to comment.