Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Saving refinements made while preparing the final exam.

  • Loading branch information...
commit eca2d88bce412eaab27ca6ace2de3581ec7de6ca 1 parent f4828d7
@chicagoscala chicagoscala authored
View
274 PragmaticsOfIndustrialSWDevelopment/html/all.html
@@ -277,19 +277,19 @@
<div class="slide">
<h1>Course Components: Project Exercises</h1>
<ul>
- <li>Start with a &#8220;running&#8221; 3-tier Scala application</li>
- <li>Hosted on <a href="http://github.com">GitHub.com</a> at <a href="http://github.com/deanwampler/AkkaWebSampleExercise">github.com/deanwampler/AkkaWebSampleExercise</a>.</li>
- <li>Uses <em>actors</em> to scale computation over a <span class="caps">NYSE</span> data set.</li>
- <li>Add features during the semester.</li>
- <li><em>Refactor</em> the code to improve it and accommodate new features.</li>
+ <li>Start with a &#8220;running&#8221; 3-tier Scala application<br />
+ * Hosted on <a href="http://github.com">GitHub.com</a> at <a href="http://github.com/deanwampler/AkkaWebSampleExercise">github.com/deanwampler/AkkaWebSampleExercise</a>. <br />
+ * Uses <em>actors</em> to scale computation over a <span class="caps">NYSE</span> data set.<br />
+ * Add features during the semester.<br />
+ * <em>Refactor</em> the code to improve it and accommodate new features.</li>
</ul>
</div>
<div class="slide">
<h1>Course Components: Project Exercises (cont.)</h1>
<ul>
- <li><em>You are encouraged to work together.</em></li>
- <li>Like you would in an industrial setting&#8230;</li>
- <li>I expect the solutions to look &#8220;similar&#8221;.</li>
+ <li><em>You are encouraged to work together.</em><br />
+ * Like you would in an industrial setting&#8230;<br />
+ * I expect the solutions to look &#8220;similar&#8221;.</li>
</ul>
</div>
<div class="slide">
@@ -305,16 +305,17 @@
<ul>
<li>5% will be based on an <strong>oral presentation</strong> on 12/7.</li>
<li>15 minutes or so, with time for questions and discussion.</li>
- <li>Topics to be worked out with me.</li>
+ <li>Topics to be worked out with me.<br />
+ <br />
+</div><br />
+<div class="slide"></li>
</ul>
-</div>
-<div class="slide">
<h1>Midterm and Final Exam</h1>
<ul>
<li>Will cover the reading, lecture material, and concepts learned in the exercises.</li>
- <li>Final exam content weighted:</li>
- <li>2/3 of the material since the midterm</li>
- <li>1/3 material before the midterm.</li>
+ <li>Final exam content weighted:<br />
+ * 2/3 of the material since the midterm <br />
+ * 1/3 material before the midterm.</li>
<li>Midterm: 10/19 (first half of that evening&#8217;s session).</li>
<li>Final exam: 12/14 (usual class time).</li>
</ul>
@@ -332,9 +333,9 @@
<div class="slide">
<h1>Scaling Computation, Part I</h1>
<ul>
- <li>Two models of concurrency compared:</li>
- <li>Multithreaded Programming.</li>
- <li>The Actor Model of concurrency.</li>
+ <li>Two models of concurrency compared: <br />
+ * Multithreaded Programming.<br />
+ * The Actor Model of concurrency.</li>
</ul>
</div>
<div class="slide">
@@ -366,7 +367,7 @@
public int getNext() {
return value++;
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/UnsafeSequence.java">code/UnsafeSequence.java</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/UnsafeSequence.java">code/UnsafeSequence.java</a></div></p>
<p>(credit: all Multithreading examples adapted from &#8220;Java Concurrency in Practice&#8221;)</p>
</div>
<div class="slide">
@@ -380,7 +381,7 @@
public synchronized int getNext() {
return value++;
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/SafeSequence.java">code/SafeSequence.java</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/SafeSequence.java">code/SafeSequence.java</a></div></p>
</div>
<div class="slide">
<h1>Things Can Go Wrong</h1>
@@ -412,7 +413,7 @@
synchronized (right) {
synchronized (left) { doSomethingElse(); }
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/LeftRightDeadlock.java">code/LeftRightDeadlock.java</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/LeftRightDeadlock.java">code/LeftRightDeadlock.java</a></div></p>
</div>
<div class="slide">
<h1>Other Deadlock Hazards</h1>
@@ -434,10 +435,11 @@
<p>A thread is not blocked, but it can&#8217;t complete work because of trying operations always fails.</p>
<ul>
<li>A common example is repeated execution of a transaction that never succeeds.</li>
- <li>One scenario is two contenders with identical strategies for trying again, often colliding in the same way. If one is <em>greedy</em>, both may succeed.</li>
+ <li>One scenario is two contenders with identical strategies for trying again, often colliding in the same way. If one is <em>greedy</em>, both may succeed.<br />
+ <br />
+</div><br />
+<div class="slide"></li>
</ul>
-</div>
-<div class="slide">
<h1>The Importance of Immutability</h1>
<p>What about access to <em>immutable</em> state? All the synchronization issues go away. Immutable objects have these virtues:</p>
<ul>
@@ -473,7 +475,7 @@
case Start =&gt; managedActors foreach (_ ! Start)
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/manager-actor.scala">code/manager-actor.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/manager-actor.scala">code/manager-actor.scala</a></div></p>
</div>
<div class="slide">
<h1>Actors in Scala (Akka)</h1>
@@ -522,7 +524,7 @@
import se.scalablesolutions.akka.actor.Actor_
// Creating an actor (one way...) and starting
val manager = Actor.actorOf[Manager]
-manager.start</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/manager-actor2.scala">code/manager-actor2.scala</a></div></p>
+manager.start</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/manager-actor2.scala">code/manager-actor2.scala</a></div></p>
</div>
<div class="slide">
<h1>Actor vs. ActorRef</h1>
@@ -542,7 +544,7 @@
case class Unregister(actor: ActorRef)
case object Stop
case object Start
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-messages.scala">code/actor-messages.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-messages.scala">code/actor-messages.scala</a></div></p>
</div>
<div class="slide">
<h1>An Asynchronous (Fire and Forget) Message</h1>
@@ -555,7 +557,7 @@
case Start =&gt; managedActors foreach (_ ! Start)
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-asynch-message.scala">code/actor-asynch-message.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-asynch-message.scala">code/actor-asynch-message.scala</a></div></p>
<p>If a response is required, the receiver can send a message to the sender.</p>
</div>
<div class="slide">
@@ -572,7 +574,7 @@
}
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-synch-message.scala">code/actor-synch-message.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-synch-message.scala">code/actor-synch-message.scala</a></div></p>
</div>
<div class="slide">
<h1>An Synchronous (Wait) Message (cont.)</h1>
@@ -595,7 +597,7 @@
case None =&gt; "Error!"
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-future-message.scala">code/actor-future-message.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-future-message.scala">code/actor-future-message.scala</a></div></p>
</div>
<div class="slide">
<h1>An Asynchronous with a Future Message (cont.)</h1>
@@ -619,7 +621,7 @@
case None =&gt; "Error!"
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-future-message2.scala">code/actor-future-message2.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/actor-future-message2.scala">code/actor-future-message2.scala</a></div></p>
</div>
<div class="slide">
<h1>Achieving Immutability</h1>
@@ -779,8 +781,9 @@
<h1>Add New Functionality (cont &#8211; sort of&#8230;)</h1>
<p>How could we modify <code>filter</code> to filter by instruments? (To make it easier, assume there is only one instrument in the list, as in the test.)</p>
<p>This is not easy, as we really need to parse the <span class="caps">JSON</span> into some representation, filter out the records (which are of the form <code>{"timestamp": 1283233404995, "symbol": "A", "price", "40.0"}</code>) using the <code>symbol</code>, then convert back to a string.</p>
-<p>Can you figure out how to do this with the Lift <span class="caps">JSON</span> APIs used in the application and <span class="caps">JSON</span> helper types provided, or using other 3rd-party <span class="caps">JSON</span> libraries?</p>
-<p>Actually, the right way to implement this feature is to support this filtering at the database level, which we will learn how to do with MongoDB.</p>
+<p>Can you figure out how to do this with the Lift <span class="caps">JSON</span> APIs used in the application and <span class="caps">JSON</span> helper types provided, or using other 3rd-party <span class="caps">JSON</span> libraries?<br />
+ <br />
+Actually, the right way to implement this feature is to support this filtering at the database level, which we will learn how to do with MongoDB.</p>
</div>
<div class="title slide">
<h1>Lecture 2: Scaling Computation, Part II, and Course Project Rebooted</h1>
@@ -1019,7 +1022,7 @@
counter // -&gt; 1
counter // -&gt; 2
-ref.get // -&gt; 2 (retrieve the value explicitly)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example1.scala">code/akka-stm-example1.scala</a></div></p>
+ref.get // -&gt; 2 (retrieve the value explicitly)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example1.scala">code/akka-stm-example1.scala</a></div></p>
</div>
<div class="slide">
<h1>Symantics (cont.)</h1>
@@ -1034,7 +1037,7 @@
atomic {
ref set 10 // set new value
} // (actually returns old value)
-ref.get // -&gt; 10</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example2.scala">code/akka-stm-example2.scala</a></div></p>
+ref.get // -&gt; 10</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example2.scala">code/akka-stm-example2.scala</a></div></p>
</div>
<div class="slide">
<h1>Symantics: Blocking (&#8220;Retry&#8221;)</h1>
@@ -1055,7 +1058,7 @@
to alter (_ + amount)
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example3.scala">code/akka-stm-example3.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example3.scala">code/akka-stm-example3.scala</a></div></p>
<p>(See <strong>Blocking Transactions</strong> on the <a href="http://doc.akkasource.org/stm-scala">Akka <span class="caps">STM</span> page</a> for the full example.)</p>
</div>
<div class="slide">
@@ -1080,7 +1083,7 @@
}
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example4.scala">code/akka-stm-example4.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example4.scala">code/akka-stm-example4.scala</a></div></p>
</div>
<div class="slide">
<h1>Composability and Modularity</h1>
@@ -1203,7 +1206,7 @@
<div class="code-tiny">
<pre name="code" id="code" class="brush: scala;">[error] Test Failed: calculateStatistics returns a JSON string containing all data that matches the instrument criteria
org.scalatest.TestFailedException: JObject(List(JField(criteria,JObject(List(JField(instruments,JArray(List(JString(A)))), JField(statistics,JArray(List(JString(price[$])))), JField(start,JInt(0)), JField(end,JInt(1283824964864))))), JField(results,JArray(List(JObject(List(JField(timestamp,JInt(1283824954864)), JField(symbol,JString(A)), JField(price,JDouble(0.0)))), JObject(List(JField(timestamp,JInt(1283824955864)), JField(symbol,JString(C)), JField(price,JDouble(10.0)))), JObject(List(JField(timestamp,JInt(1283824956864)), JField(symbol,JString(A)), JField(price,JDouble(20.0)))), JObject(List(JField(timestamp,JInt(1283824957864)), JField(symbol,JString(B)), JField(price,JDouble(30.0)))), JObject(List(JField(timestamp,JInt(1283824958864)), JField(symbol,JString(A)), JField(price,JDouble(40.0))))))))) did not equal JObject(List(JField(criteria,JObject(List(JField(instruments,JArray(List(JString(A)))), JField(statistics,JArray(List(JString(price[$])))), JField(start,JInt(0)), JField(end,JInt(1283824964864))))), JField(results,JArray(List(JObject(List(JField(timestamp,JInt(1283824954864)), JField(symbol,JString(A)), JField(price,JDouble(0.0)))), JObject(List(JField(timestamp,JInt(1283824958864)), JField(symbol,JString(A)), JField(price,JDouble(40.0)))), JObject(List(JField(timestamp,JInt(1283824956864)), JField(symbol,JString(A)), JField(price,JDouble(20.0)))))))))
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/exercise1-test-failure.scala">code/exercise1-test-failure.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/exercise1-test-failure.scala">code/exercise1-test-failure.scala</a></div></p>
<p>(Yeah!)</p>
</div>
<div class="slide">
@@ -1233,10 +1236,11 @@
<p><code>~test-only org.chicagoscala.awse.server.finance.InstrumentAnalysisServerTest</code></p>
<ul>
<li>Note that it will wait (no prompt is returned) and every time you save code changes, this test will run.</li>
- <li>Using the <code>~test-only</code> &#8220;action&#8221; saves time, running in a few seconds, while running all the tests takes longer.</li>
+ <li>Using the <code>~test-only</code> &#8220;action&#8221; saves time, running in a few seconds, while running all the tests takes longer.<br />
+ <br />
+</div><br />
+<div class="slide"></li>
</ul>
-</div>
-<div class="slide">
<h1>Add New Functionality (cont.)</h1>
<ul>
<li>Now, in your editor of choice, open the file <code>main/scala/server/finance/InstrumentAnalysisServer.scala</code> (the file being tested&#8230;)</li>
@@ -1699,8 +1703,9 @@
<div class="slide">
<h1>Tightly Coupled (Clustered)</h1>
<p>Usually refers to a cluster of servers or services that collaborate closely, perhaps to solve a problem with <em>divide and conquer</em> after which the individual contributions are combined to produce the final result.</p>
-<p>Tight coupling may imply that failure of one element causes the work of all elements to fail. An exception is typical <em>map-reduce</em> systems (which we&#8217;ll discuss in a subsequent lecture), like <em>Hadoop</em>, which handle single node failures.</p>
-<p>Example:</p>
+<p>Tight coupling may imply that failure of one element causes the work of all elements to fail. An exception is typical <em>map-reduce</em> systems (which we&#8217;ll discuss in a subsequent lecture), like <em>Hadoop</em>, which handle single node failures.<br />
+ <br />
+Example:</p>
<ul>
<li>Multicore Processor</li>
<li>Map-Reduce</li>
@@ -1798,10 +1803,11 @@
<li>Edit <code>RestfulDataPublisher.scala</code>. We need to do a little <em>refactoring</em> first.</li>
<li>Change <code>getStatsFromInstrumentAnalysisServerSupervisors</code> to take this argument: <code>message: InstrumentCalculationMessages</code>.</li>
<li>Change <code>supervisor !! CalculateStatistics(allCriteria)</code> to <code>supervisor !! message</code>.</li>
- <li>Now this method is more general to meet our needs.</li>
+ <li>Now this method is more general to meet our needs.<br />
+ <br />
+</div><br />
+<div class="slide"></li>
</ul>
-</div>
-<div class="slide">
<h1>Add New Functionality (step 6)</h1>
<ul>
<li>Also in <code>RestfulDataPublisher.scala</code>, in method <code>getAllDataFor</code>, change:</li>
@@ -2383,8 +2389,9 @@
</div>
<div class="slide">
<h1>Key-Value Stores</h1>
-<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, MNesia.</em></p>
-<p>Think of hash maps on <em>steroids</em>.</p>
+<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, MNesia.</em><br />
+ <br />
+Think of hash maps on <em>steroids</em>.</p>
<ul>
<li>May be purely in-memory (with optional flushing to disk) and resident on one machine.</li>
<li>Excellent for &#8220;persisting&#8221; semi-structured data with shorter lifespans (e.g., web sessions).</li>
@@ -2418,9 +2425,9 @@
</div>
<div class="slide">
<h1>&#8220;Polyglot Persistence&#8221;</h1>
-<p>A big trend today is that non-trivial systems mix different programming languages, libraries and tools. Do we use just one language to write all parts of a standard web application? No.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<p>A big trend today is that non-trivial systems mix different programming languages, libraries and tools. Do we use just one language to write all parts of a standard web application? No.<sup class="footnote"><a href="#fn1">1</a></sup></p>
<p>The same phenomenon is now happening at the persistence level. Often, one persistence strategy doesn&#8217;t fit all needs in complex, distributed systems. You might use a fast, key-value store for user sessions, then persist key &#8220;events&#8221; to an <span class="caps">RDBMS</span>, for example.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> Well, maybe we could with JavaScript&#8230;</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> Well, maybe we could with JavaScript&#8230;</p>
</div>
<div class="slide">
<h1>Some Techniques We&#8217;ll Discuss</h1>
@@ -2614,8 +2621,9 @@
</div>
<div class="slide">
<h1>Key-Value Stores</h1>
-<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, Mnesia.</em></p>
-<p>Think of hash maps on <em>steroids</em>.</p>
+<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, Mnesia.</em><br />
+ <br />
+Think of hash maps on <em>steroids</em>.</p>
<ul>
<li>May be purely in-memory (with optional flushing to disk) and resident on one machine.</li>
<li>Excellent for &#8220;persisting&#8221; semi-structured data with shorter lifespans (e.g., web sessions).</li>
@@ -3022,9 +3030,10 @@ <h1 class="slide0">Lecture 6: Scaling Data, Part <span class="caps">III</span></
<li>To hard to do this manually.</li>
<li>Keys are hashed, using consistent hashing.</li>
<li>The range of possible hash values is treated as a &#8220;ring&#8221; that wraps.</li>
- <li>Each node is assigned a random position on the ring.</li>
+ <li>Each node is assigned a random position on the ring.<br />
+ <br />
+When a row&#8217;s key is hashed, the node with the closest key <em>greater than</em> the row&#8217;s key is assigned the responsibility for coordinating reads and writes.</li>
</ul>
-<p>When a row&#8217;s key is hashed, the node with the closest key <em>greater than</em> the row&#8217;s key is assigned the responsibility for coordinating reads and writes.</p>
</div>
<div class="slide">
<h1>Reads and Writes</h1>
@@ -4024,15 +4033,15 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<ul>
<li>Once a constructor completes, the object should be in a <em>known-good state</em>.</li>
<li><em>Every</em> method should transition the object from one known-good state to another (possibly the same) known-good state.</li>
- <li>Clean up resources when the object becomes garbage.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> <sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup></li>
+ <li>Clean up resources when the object becomes garbage.<sup class="footnote"><a href="#fn1">1</a></sup> <sup class="footnote"><a href="#fn2">2</a></sup></li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> C++ and C# have <em>destructors</em> for this purpose (but they may be invoked too late for some resources, like database connections).<br />
-<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> Java has finalizers, but they are effectively useless, maybe even harmful.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> C++ and C# have <em>destructors</em> for this purpose (but they may be invoked too late for some resources, like database connections).<br />
+<sup class="footnote"><a href="#fn2">2</a></sup> Java has finalizers, but they are effectively useless, maybe even harmful.</p>
</div>
<div class="slide">
-<h1>Design by Contract<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></h1>
+<h1>Design by Contract<sup class="footnote"><a href="#fn1">1</a></sup></h1>
<p><a href="http://en.wikipedia.org/wiki/Design_by_contract">Design by Contract</a> (DbC) is a programming discipline where you specify assertions about program behavior that the language infrastructure can enforce during testing, but disable in production deployments, for performance reasons.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> A registered trademark of Eiffel Software</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> A registered trademark of Eiffel Software</p>
</div>
<div class="slide">
<h1>Design by Contract (cont.)</h1>
@@ -4047,8 +4056,9 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class="slide">
<h1>Preconditions</h1>
<p><strong>Preconditions</strong> are what must be true in order for the function to do its job. A trivial example: there must be enough free memory for the function to allocate the objects it creates.</p>
-<p>Hence, these are requirements on the runtime environment and the clients using the function. Here is an example using our Windowing <span class="caps">API</span> and a &#8220;mythical&#8221; DbC framework that uses annotations.</p>
-<div class="code-small">
+<p>Hence, these are requirements on the runtime environment and the clients using the function. Here is an example using our Windowing <span class="caps">API</span> and a &#8220;mythical&#8221; DbC framework that uses annotations.<br />
+ <br />
+<div class="code-small"></p>
<pre name="code" id="code" class="brush: scala,;">
package gui.windowing {
@@ -4064,8 +4074,9 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class="slide">
<h1>Postconditions</h1>
<p><strong>Postconditions</strong> are what the function guarantees to satisfy when it finishes its job, <em>if</em> the preconditions are true. A trivial example: a function might promise to never return <code>null</code>.</p>
-<p>Hence, these are requirements on the function itself, constituting promises to clients. Here is an example using our Windowing <span class="caps">API</span>.</p>
-<div class="code-small">
+<p>Hence, these are requirements on the function itself, constituting promises to clients. Here is an example using our Windowing <span class="caps">API</span>.<br />
+ <br />
+<div class="code-small"></p>
<pre name="code" id="code" class="brush: scala,;">
package gui.windowing {
@@ -4081,8 +4092,9 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
</div>
<div class="slide">
<h1>Invariants</h1>
-<p><strong>Invariants</strong> must be true before and after function invocation. They may specify some object (or global) property that doesn&#8217;t change. They may specify a logical constraint that must remain true, etc. Invariants can be requirements on the function, the environment, or both.</p>
-<div class="code-small">
+<p><strong>Invariants</strong> must be true before and after function invocation. They may specify some object (or global) property that doesn&#8217;t change. They may specify a logical constraint that must remain true, etc. Invariants can be requirements on the function, the environment, or both.<br />
+ <br />
+<div class="code-small"></p>
<pre name="code" id="code" class="brush: scala,;">
package gui.windowing {
@@ -4121,7 +4133,6 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<h1>Scala Has Classes (for Example)</h1>
<p>Scala example, patterned after Java&#8217;s <code>Exception</code> Hierarchy:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
class Exception(
@@ -4292,7 +4303,6 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<p><em>Prototype-based languages</em> don&#8217;t have classes. (Hence they are also called <em>classless</em> languages.) Instead, you just build up objects &#8220;from scratch&#8221;.</p>
<p>JavaScript object-literal notation (essentially, a hash map):<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
var exception = {
@@ -4317,8 +4327,8 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class="slide">
<h1>Aside: <em>Open Classes</em></h1>
<p>Note that many <em>dynamically-typed, class-based</em> languages, e.g., Ruby, allow this kind of object modification, too. They are said to have <em>open classes</em>.</p>
-<p>Most <em>statically-typed</em> languages, like Scala, Java, C#, and C++, have closed classes. You can&#8217;t add or remove members in objects.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> There are some workarounds, both byte-code level hacks and some language features, like Scala&#8217;s <em>implicits</em>.</p>
+<p>Most <em>statically-typed</em> languages, like Scala, Java, C#, and C++, have closed classes. You can&#8217;t add or remove members in objects.<sup class="footnote"><a href="#fn1">1</a></sup></p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> There are some workarounds, both byte-code level hacks and some language features, like Scala&#8217;s <em>implicits</em>.</p>
</div>
<div class="slide">
<h1>Prototype-Based Languages (cont.)</h1>
@@ -4504,7 +4514,6 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<h1><code>Option[+A]</code>: <code>case</code> class (cont.)</h1>
<p>So, adding <code>case</code> to the declaration is equivalent to this:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
final class Some[+A](val x: A) extends Option[+A] {
@@ -4539,7 +4548,6 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<p><strong>Nothing</strong>: A subtype of <em>all</em> other types, with <em>no</em> instances.</p>
<p>Used for proper type safety.<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
case object None extends Option[Nothing] {...}
@@ -4773,8 +4781,9 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
</div>
<div class="slide">
<h1>Uniform-Access Principle (cont.)</h1>
-<p>The <em>caller</em> doesn&#8217;t care whether a method is invoked or a bare field is accessed.</p>
-<p>The <em>implementer</em> might want to start with a simple bare field access, then eventually replace it with a method call (e.g., to do lazy initialization, etc.).</p>
+<p>The <em>caller</em> doesn&#8217;t care whether a method is invoked or a bare field is accessed.<br />
+ <br />
+The <em>implementer</em> might want to start with a simple bare field access, then eventually replace it with a method call (e.g., to do lazy initialization, etc.).</p>
<p>The <em>uniform-access principle</em> means the caller&#8217;s code doesn&#8217;t have to change, because the syntax is identical. (The code might need a recompile).</p>
</div>
<div class="slide">
@@ -4881,7 +4890,6 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<h1>Other Modules</h1>
<p><span class="caps">BAD</span>:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
object MyApp {
@@ -4893,7 +4901,6 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
</pre></div>
<p><span class="caps">GOOD</span>:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
object MyApp {
@@ -5555,8 +5562,8 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class="slide">
<h1>What Is Functional Programming?</h1>
<p>FP treats computation as the <em>application of functions</em> rather than the direct <em>mutation of state</em>.</p>
-<p>FP has its roots in mathematics, specifically <em>lambda calculus</em><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>, a formal system developed in the 1930s to investigate function definition, function application, recursion, etc. (Yes, before the invention of electronic computers.) Many functional programming languages can be viewed as elaborations on the lambda calculus.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> For this reason, anonymous functions in many languages are called <em>lambdas</em>.</p>
+<p>FP has its roots in mathematics, specifically <em>lambda calculus</em><sup class="footnote"><a href="#fn1">1</a></sup>, a formal system developed in the 1930s to investigate function definition, function application, recursion, etc. (Yes, before the invention of electronic computers.) Many functional programming languages can be viewed as elaborations on the lambda calculus.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> For this reason, anonymous functions in many languages are called <em>lambdas</em>.</p>
<p>(Adapted from <a href="http://en.wikipedia.org/wiki/Functional_programming">Wikipedia</a>.)</p>
</div>
<div class="slide">
@@ -5588,9 +5595,9 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<h1>No Side Effects</h1>
<p>Just as <code>x</code> is not mutable, so to is the rest of the world. So, by definition, immutability means there can be no <em>side effects</em>. This also has important implications for functions:</p>
<p>x = cos(y)<sup>2</sup></p>
-<p><strong>All</strong> work done by <code>cos(y)</code> (for example) is returned and assigned to <code>x</code>. there is no global state that is updated.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<p><strong>All</strong> work done by <code>cos(y)</code> (for example) is returned and assigned to <code>x</code>. there is no global state that is updated.<sup class="footnote"><a href="#fn1">1</a></sup></p>
<p>Functions without side effects are called <em>pure.</em></p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> However, a real implementation might update &#8220;invisible&#8221; state like a cache of previously-calculated values.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> However, a real implementation might update &#8220;invisible&#8221; state like a cache of previously-calculated values.</p>
</div>
<div class="slide">
<h1>Benefits of No Side Effects</h1>
@@ -5710,8 +5717,8 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
// =&gt; two
// =&gt; 3.3
</pre></div>
-<p>Note that we use the wildcard <code>_</code> for the <code>List[_]</code> parameter, because we don&#8217;t care what it is.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> Actually, on the <span class="caps">JVM</span> we have no choice, because this type information is <em>erased</em> in the byte code.</p>
+<p>Note that we use the wildcard <code>_</code> for the <code>List[_]</code> parameter, because we don&#8217;t care what it is.<sup class="footnote"><a href="#fn1">1</a></sup></p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> Actually, on the <span class="caps">JVM</span> we have no choice, because this type information is <em>erased</em> in the byte code.</p>
</div>
<div class="slide">
<h1>Higher-Kinded Types (cont.)</h1>
@@ -5913,8 +5920,8 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class="slide">
<h1><span class="caps">OCP</span> and The Expression Problem (cont.)</h1>
<p>The object-oriented approach is to use <em>inheritance</em>, where clients depend only on a <em>well-defined abstraction</em>, which is implemented by <em>concrete subtypes</em>. New &#8220;behaviors&#8221; can be added by defining new concrete subtypes for the same abstraction.</p>
-<p>As long as the abstraction is sufficiently expressive and clients don&#8217;t depend on the concrete subtypes, we can add new behaviors to the code base without modifying existing code.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> Recall that, every now and then, the abstraction won&#8217;t be general enough to support a new behavior, so the abstraction and possibly all the subtypes will require modification.</p>
+<p>As long as the abstraction is sufficiently expressive and clients don&#8217;t depend on the concrete subtypes, we can add new behaviors to the code base without modifying existing code.<sup class="footnote"><a href="#fn1">1</a></sup></p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> Recall that, every now and then, the abstraction won&#8217;t be general enough to support a new behavior, so the abstraction and possibly all the subtypes will require modification.</p>
</div>
<div class="slide">
<h1><span class="caps">OCP</span> and The Expression Problem (cont.)</h1>
@@ -6395,7 +6402,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -6442,7 +6449,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -6463,7 +6470,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -6490,7 +6497,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -6523,7 +6530,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -6562,7 +6569,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -6630,13 +6637,13 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<div class="slide">
<h1>Software Reuse</h1>
<p>I&#8217;ll show an example later that compares modeling domain concepts with <em>classes</em> vs. representing objects as <em>maps</em> (which is how objects <em>are</em> represented in languages like JavaScript and Perl).</p>
-<p>There are some significant benefits for <em>reuse</em> when using such functional data structures<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>.</p>
+<p>There are some significant benefits for <em>reuse</em> when using such functional data structures<sup class="footnote"><a href="#fn1">1</a></sup>.</p>
<ul>
<li>These types are very well tested.</li>
<li>They provide a variety of functions for computations over the collections.</li>
<li>They define a few usage <em>protocols</em> that are flexible and powerful.</li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> As opposed to the dumbed-down versions found in Java, etc.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> As opposed to the dumbed-down versions found in Java, etc.</p>
</div>
<div class="slide">
<h1>Software Reuse (cont.)</h1>
@@ -6823,7 +6830,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
case class CheckingAccount(customer: Customer, var balance: Money) extends Account
case class SavingsAccount(customer: Customer, var balance: Money,
var interestRate: Double) extends Account
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account.scala">code/bank-account.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account.scala">code/bank-account.scala</a></div></p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span>: An Example Problem (cont.)</h1>
@@ -6846,7 +6853,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
// Checking: initial account: CheckingAccount(Customer(Dean),Money(1000.0))
// Checking: final account: CheckingAccount(Customer(Dean),Money(1500.0))
// Savings: initial account: SavingsAccount(Customer(Dean),Money(2000.0),0.02)
-// Checking: final account: SavingsAccount(Customer(Dean),Money(900.0),0.3)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-usage.scala">code/bank-account-usage.scala</a></div></p>
+// Checking: final account: SavingsAccount(Customer(Dean),Money(900.0),0.3)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-usage.scala">code/bank-account-usage.scala</a></div></p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span> and Modularity</h1>
@@ -6868,7 +6875,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
_name = newName
putToDatabase("name", _name)
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-bad-persistence.scala">code/bank-account-bad-persistence.scala</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-bad-persistence.scala">code/bank-account-bad-persistence.scala</a></div></p>
</div>
<div class="slide">
<h1>Modularity Breakdown</h1>
@@ -6894,10 +6901,10 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
</div>
<div class="slide">
<h1>Enterprise Java Beans</h1>
-<p><em>Enterprise Java Beans</em> (EJBs) where a flawed attempt to address this problem (the flaws were mostly fixed in the v3.0 redo<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>). This model let you specify some data for persistence, transactions, security, etc. in <span class="caps">XML</span> configuration files, but you still had very invasive code in your domain objects.</p>
+<p><em>Enterprise Java Beans</em> (EJBs) where a flawed attempt to address this problem (the flaws were mostly fixed in the v3.0 redo<sup class="footnote"><a href="#fn1">1</a></sup>). This model let you specify some data for persistence, transactions, security, etc. in <span class="caps">XML</span> configuration files, but you still had very invasive code in your domain objects.</p>
<p>Specifically, while the model &#8220;separated concerns&#8221; such as persistence from the domain model, the model objects needed to subclass <span class="caps">EJB</span> container types, implement methods to support lifecycle management, etc.</p>
<p>That is, EJBs traded one set of problems for another set.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> But only after the Spring Framework and the <span class="caps">AOP</span> community showed a better way.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> But only after the Spring Framework and the <span class="caps">AOP</span> community showed a better way.</p>
</div>
<div class="slide">
<h1>Aspect-Oriented Programming</h1>
@@ -6925,9 +6932,9 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
<p>An aspect framework has two parts.</p>
<ul>
<li><strong>Quantification:</strong> The ability to specify, in a succinct way (programmatically or declaratively), which &#8220;points of execution&#8221; to observe or modify. It&#8217;s analogous to a query language over the set of execution points.</li>
- <li><strong>Behavior Modification</strong>: Once the set of execution points is identified, you need ways to observe or modify the behavior, <em>without modifying the original code</em><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>.</li>
+ <li><strong>Behavior Modification</strong>: Once the set of execution points is identified, you need ways to observe or modify the behavior, <em>without modifying the original code</em><sup class="footnote"><a href="#fn1">1</a></sup>.</li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> I.e., this a special case of the Expression Problem, a.k.a Open-Closed Principle.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> I.e., this a special case of the Expression Problem, a.k.a Open-Closed Principle.</p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span> Terminology</h1>
@@ -6961,7 +6968,7 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
customer.name = newName
putToDatabase("name", newName)
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-instrumented.scala">code/bank-account-instrumented.scala</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-instrumented.scala">code/bank-account-instrumented.scala</a></div></p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span> Tools</h1>
@@ -6997,13 +7004,13 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
case None =&gt;
}
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-aspect.scala">code/bank-account-aspect.scala</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-aspect.scala">code/bank-account-aspect.scala</a></div></p>
</div>
<div class="slide">
<h1>Aspects Beyond Cross-Cutting Concerns</h1>
-<p>Note that the cross-cutting concerns that we mentioned, persistence, transactions, security, and logging, are sometimes called <em>non-functional requirements</em>, because they mostly relate to implementation concerns, rather than business requirements.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<p>Note that the cross-cutting concerns that we mentioned, persistence, transactions, security, and logging, are sometimes called <em>non-functional requirements</em>, because they mostly relate to implementation concerns, rather than business requirements.<sup class="footnote"><a href="#fn1">1</a></sup></p>
<p>Is this the only use for aspects?</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> This is not really an accurate distinction; everything we do is ultimately tied in some way to business requirements.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> This is not really an accurate distinction; everything we do is ultimately tied in some way to business requirements.</p>
</div>
<div class="slide">
<h1>Aspects Beyond Cross-Cutting Concerns</h1>
@@ -7065,15 +7072,15 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
case class Customer(var name: String) extends Named
-val dean = new Customer("Dean") with PersistentName</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-mixin.scala">code/bank-account-mixin.scala</a></div></p>
+val dean = new Customer("Dean") with PersistentName</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-mixin.scala">code/bank-account-mixin.scala</a></div></p>
</div>
<div class="slide">
<h1>Why Isn&#8217;t <span class="caps">AOP</span> Pervasive? (cont.)</h1>
<p>So we can get <em>advice</em> without aspects, although it&#8217;s still tedious to write all these special cases. However, we still don&#8217;t have <em>quantification</em>.</p>
<p>Functional data structures can address both limitations.</p>
<p>Objects are just ad hoc groupings of collections and &#8220;atoms&#8221; (numbers, strings, etc.), recursively. More specifically, they work like <em>maps</em> and in languages like JavaScript, they <em>are</em> maps!</p>
-<p>So, if we create a <code>PersistentMap</code><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>, in this case, and represent our objects as maps, we&#8217;ve solved the quantification problem!</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> In this case, meaning persistent to a database, not as in the <em><span class="caps">STM</span></em> case.</p>
+<p>So, if we create a <code>PersistentMap</code><sup class="footnote"><a href="#fn1">1</a></sup>, in this case, and represent our objects as maps, we&#8217;ve solved the quantification problem!</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> In this case, meaning persistent to a database, not as in the <em><span class="caps">STM</span></em> case.</p>
</div>
<div class="slide">
<h1>Why Isn&#8217;t <span class="caps">AOP</span> Pervasive? (cont.)</h1>
@@ -7100,13 +7107,13 @@ <h1 class="slide0">Lecture 8: Effective Object-Oriented Programming (<span class
}
val dean = new HashMap[String,Any] with PersistentMap[String,Any]
-dean.put("name", "Dean")</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/persistent-map.scala">code/persistent-map.scala</a></div></p>
+dean.put("name", "Dean")</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/persistent-map.scala">code/persistent-map.scala</a></div></p>
</div>
<div class="slide">
<h1>Why Isn&#8217;t <span class="caps">AOP</span> Pervasive? (cont.)</h1>
<p>What this means is that if we just use <code>Maps</code> (and perhaps a few other fundamental collections), we can instrument them as needed with less effort than instrumenting lots of ad-hoc classes. The quantification problem is reduced.</p>
-<p>The key point here is that working with more &#8220;primitive&#8221; building blocks; functions, and core data structures, it is actually easier to <em>generate</em> the variations of behavior we need.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> We&#8217;ll return to this point in a few weeks when we talk about <em>simplicity</em> in systems, etc.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> We can make the behaviors more <em>composable</em> using advanced techniques like <em>monads</em>.</p>
+<p>The key point here is that working with more &#8220;primitive&#8221; building blocks; functions, and core data structures, it is actually easier to <em>generate</em> the variations of behavior we need.<sup class="footnote"><a href="#fn1">1</a></sup> We&#8217;ll return to this point in a few weeks when we talk about <em>simplicity</em> in systems, etc.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> We can make the behaviors more <em>composable</em> using advanced techniques like <em>monads</em>.</p>
</div>
<div class="slide">
<h1>Conclusions: <span class="caps">OOP</span> vs. FP (vs. <span class="caps">AOP</span>)</h1>
@@ -7342,9 +7349,9 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
</div>
<div class="slide">
<h1>Waterfall Model of Software Development</h1>
-<p>The Waterfall Process resulted from a historical accident.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> During the 60s, many researches recognized the importance of iterative development. One paper was &#8220;Managing the Development of Large Software Systems&#8221;, by Winston Royce, in Proceedings of <span class="caps">IEEE</span> Westcon.</p>
+<p>The Waterfall Process resulted from a historical accident.<sup class="footnote"><a href="#fn1">1</a></sup> During the 60s, many researches recognized the importance of iterative development. One paper was &#8220;Managing the Development of Large Software Systems&#8221;, by Winston Royce, in Proceedings of <span class="caps">IEEE</span> Westcon.</p>
<p>This paper started with an image similar to the one two slides ago, <em>but</em> it went on to argue that such a process <em>can&#8217;t work</em>, because feedback is required.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> Craig Larman, &#8220;Agile and Iterative Development: A Manager&#8217;s Guide&#8221;, pp 102-107.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> Craig Larman, &#8220;Agile and Iterative Development: A Manager&#8217;s Guide&#8221;, pp 102-107.</p>
</div>
<div class="slide">
<h1>Waterfall Model of Software Development</h1>
@@ -7459,7 +7466,7 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
<table>
<tr>
<th>Name </th>
- <th>Agile &#8220;School&#8221;<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> </th>
+ <th>Agile &#8220;School&#8221;<sup class="footnote"><a href="#fn1">1</a></sup> </th>
</tr>
<tr>
<td> Kent Beck </td>
@@ -7483,7 +7490,7 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
</tr>
<tr>
<td> Martin Fowler </td>
- <td> Consultant<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td>
+ <td> Consultant<sup class="footnote"><a href="#fn2">2</a></sup> </td>
</tr>
<tr>
<td> James Grenning </td>
@@ -7494,8 +7501,8 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
<td> Adaptive Software Development </td>
</tr>
</table>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
-<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
+<sup class="footnote"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
</div>
</div>
<div class="slide">
@@ -7504,11 +7511,11 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
<table>
<tr>
<th>Name </th>
- <th>Agile &#8220;School&#8221;<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> </th>
+ <th>Agile &#8220;School&#8221;<sup class="footnote"><a href="#fn1">1</a></sup> </th>
</tr>
<tr>
<td> Andrew Hunt </td>
- <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td>
+ <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote"><a href="#fn2">2</a></sup> </td>
</tr>
<tr>
<td> Ron Jeffries </td>
@@ -7540,22 +7547,23 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
</tr>
<tr>
<td> Dave Thomas </td>
- <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td>
+ <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote"><a href="#fn2">2</a></sup> </td>
</tr>
</table>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
-<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
+<sup class="footnote"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
</div>
</div>
<div class="slide">
-<h1>Three Agile Methods: Scrum, XP, and Lean</h1>
-<p>While there are several different agile methods mentioned, we&#8217;ll discuss the three most popular.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<h1>Three Agile Methods: Scrum, XP, and Lean<br />
+ <br />
+While there are several different agile methods mentioned, we&#8217;ll discuss the three most popular.<sup class="footnote"><a href="#fn1">1</a></sup></h1>
<ul>
<li><strong>Scrum</strong> &#8211; focuses on project management.</li>
<li><strong>XP</strong> &#8211; a complete, small-team approach, addressing project management and developer practices.</li>
<li><strong>Lean</strong> &#8211; inspired by Toyota Lean, &#8220;Just-in-Time&#8221; Manufacturing.</li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> See Highsmith&#8217;s &#8220;Agile Software Development Ecosystems&#8221; for an excellent survey of the major agile methods (in 2002).</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> See Highsmith&#8217;s &#8220;Agile Software Development Ecosystems&#8221; for an excellent survey of the major agile methods (in 2002).</p>
</div>
<div class="slide">
<h1>Three Agile Methods: Scrum, XP, and Lean</h1>
@@ -7573,7 +7581,7 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
<img src="images/800px-Scrum_process.png"></img>
</center>
<div class='small cite'>
-<p>(source: <a href="http://en.wikipedia.org/wiki/Scrum_(development)">Wikipedia</a>)</p>
+<p>(source: <a href="http://en.wikipedia.org/wiki/Scrum_(development">Wikipedia</a>))</p>
</div>
</div>
<div class="slide">
@@ -7893,7 +7901,7 @@ <h1 class="slide0">Lecture 12: Complexity vs. Simplicity Part I: Effective Softw
<h1>Reading Assignment (cont.)</h1>
<p>Last week, I had you read some general introductions to Agile. This week, I want you read about the three main Agile methodologies that we discussed today.</p>
<ul>
- <li><a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a>.</li>
+ <li><a href="http://en.wikipedia.org/wiki/Scrum_(development">Scrum</a>).</li>
<li><a href="http://en.wikipedia.org/wiki/Extreme_Programming">Extreme Programming</a>. Focus especially on the sections that describe the Values, Principles, and Practices.</li>
<li><a href="http://en.wikipedia.org/wiki/Lean_software_development">Lean Software Development</a>.</li>
</ul>
@@ -8181,19 +8189,20 @@ <h1 class="slide0">Lecture 13: Complexity vs. Simplicity Part II: Simple Systems
<div class="slide">
<h1><span class="caps">HTTP</span> Protocol</h1>
<p><span class="caps">HTTP</span> supports only 9 <em>request methods</em> (a.k.a. &#8220;verbs&#8221;): <code>HEAD</code>, <code>GET</code>, <code>POST</code>, <code>PUT</code>, <code>DELETE</code>, <code>TRACE</code>, and <code>OPTIONS</code>. Just <code>GET</code> and <code>POST</code> are used to do the vast majority of work on the Interwebs&#8230;</p>
-<p>These nine methods let us do <em>everything</em><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> we&#8217;ve been doing on the web for the last ~15 years!</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> I mean the <span class="caps">HTTP</span>-based <em>world-wide web</em>, as it was originally conceived, not including other <em>Internet</em> protocols that we also use, like those for email.</p>
+<p>These nine methods let us do <em>everything</em><sup class="footnote"><a href="#fn1">1</a></sup> we&#8217;ve been doing on the web for the last ~15 years!</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> I mean the <span class="caps">HTTP</span>-based <em>world-wide web</em>, as it was originally conceived, not including other <em>Internet</em> protocols that we also use, like those for email.</p>
</div>
<div class="slide">
<h1><span class="caps">HTTP</span> Protocol</h1>
-<p><span class="caps">HTTP</span> request messages consist of a list of headers (key-value pairs), one per line, followed by a blank line, followed by the message body (which may be empty).</p>
-<p>Here&#8217;s the output when requesting the Wikipedia page for <span class="caps">HTTP</span>, using <code>curl</code><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> and its <code>--include</code> option to also print the headers:</p>
+<p><span class="caps">HTTP</span> request messages consist of a list of headers (key-value pairs), one per line, followed by a blank line, followed by the message body (which may be empty).<br />
+ <br />
+Here&#8217;s the output when requesting the Wikipedia page for <span class="caps">HTTP</span>, using <code>curl</code><sup class="footnote"><a href="#fn1">1</a></sup> and its <code>--include</code> option to also print the headers:</p>
<div class="code-small">
<pre name="code" id="code" class="brush: shell,;">
curl --include http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
</pre></div>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> <code>wget</code> is similar program available on many systems.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> <code>wget</code> is similar program available on many systems.</p>
</div>
<div class="slide">
<h1><span class="caps">HTTP</span> Protocol</h1>
@@ -8478,7 +8487,7 @@ <h1 class="slide0">Lecture 13: Complexity vs. Simplicity Part II: Simple Systems
<li><a href="http://dbmsmusings.blogspot.com/2010/04/problems-with-cap-and-yahoos-little.html">My Problem with <span class="caps">CAP</span> and Yahoo&#8217;s Little Known NoSQL System</a>.</li>
<li>Werner Vogels, <a href="http://portal.acm.org/ft_gateway.cfm?id=1466448&amp;type=pdf">Eventually Consistent</a>. (Also <a href="http://www.allthingsdistributed.com/2008/12/eventually_consistent.html">here</a>) A specific look at different kinds of eventual consistency and how they informed the design of several Amazon technologies.</li>
<li>Haifeng Yu and Amin Vahdat, <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.7743&amp;rep=rep1&amp;type=pdf">Design and Evaluation of a Continuous Consistency Model for Replicated Services</a></li>
- <li>Guy Pardon, <a href="http://guysblogspot.blogspot.com/2008/09/cap-solution-proving-brewer-wrong.html" title="Proving Brewer Wrong">A <span class="caps">CAP</span> Solution</a>. An argument that if you don&#8217;t require all three properties at the same time, you can work around the <span class="caps">CAP</span> theorem.<br />
+ <li>Guy Pardon, <a href="http://guysblogspot.blogspot.com/2008/09/cap-solution-proving-brewer-wrong.html" title="Proving Brewer Wrong">>CAP</span> Solution</a>. An argument that if you don&#8217;t require all three properties at the same time, you can work around the <span class="caps">CAP</span> theorem.<br />
</div></li>
</ul>
</div>
@@ -8693,10 +8702,11 @@ <h1 class="slide0">Lecture 13: Complexity vs. Simplicity Part II: Simple Systems
<li><a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singleton Design Pattern</a> (Wikipedia).</li>
<li><a href="http://en.wikipedia.org/wiki/Visitor_pattern">Visitor Pattern</a> (Wikipedia). A truly ugly pattern. A good illustration of forcing a &#8220;pure&#8221; OO solution when a much more elegant approach should be used instead, i.e., <em>type classes</em> (see the FP section below.)</li>
<li><a href="http://www.c2.com/cgi/wiki?AreDesignPatternsMissingLanguageFeatures">Are Design Patterns Missing Language Features</a>. A starting place for criticisms of patterns.</li>
- <li>Peter Norvig, <a href="http://www.norvig.com/design-patterns">Design Patterns</a>. Argues that 16 of the 23 GoF patterns are unnecessary in languages like Lisp.</li>
+ <li>Peter Norvig, <a href="http://www.norvig.com/design-patterns">Design Patterns</a>. Argues that 16 of the 23 GoF patterns are unnecessary in languages like Lisp.<br />
+ <br />
+</div></li>
</ul>
</div>
-</div>
<div class="slide">
<h1>Object-Oriented Programming (Specifics)</h1>
<div class='small'>
@@ -8806,7 +8816,7 @@ <h1 class="slide0">Lecture 13: Complexity vs. Simplicity Part II: Simple Systems
<ul>
<li>Ken Schwaber, &#8220;Agile Project Management with Scrum&#8221;, Microsoft Press, 2004. <span class="caps">ISBN</span> 978-0-735-61993-7.</li>
<li>Ken Schwaber, &#8220;Agile Project Management with Scrum&#8221;, Microsoft Press, 2004. <span class="caps">ISBN</span> 978-0-735-61993-7.</li>
- <li><a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum Development</a> (Wikipedia).<br />
+ <li><a href="http://en.wikipedia.org/wiki/Scrum_(development">Scrum Development</a>) (Wikipedia).<br />
</div></li>
</ul>
</div>
View
50 PragmaticsOfIndustrialSWDevelopment/html/lecture11.html
@@ -158,7 +158,7 @@
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -205,7 +205,7 @@
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -226,7 +226,7 @@
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -253,7 +253,7 @@
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -286,7 +286,7 @@
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -325,7 +325,7 @@
<div class='tiny'>
<table>
<tr>
- <th></th>
+ <th> </th>
<th>Pre-Internet </th>
<th>Internet </th>
<th>Big Data </th>
@@ -393,13 +393,13 @@
<div class="slide">
<h1>Software Reuse</h1>
<p>I&#8217;ll show an example later that compares modeling domain concepts with <em>classes</em> vs. representing objects as <em>maps</em> (which is how objects <em>are</em> represented in languages like JavaScript and Perl).</p>
-<p>There are some significant benefits for <em>reuse</em> when using such functional data structures<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>.</p>
+<p>There are some significant benefits for <em>reuse</em> when using such functional data structures<sup class="footnote"><a href="#fn1">1</a></sup>.</p>
<ul>
<li>These types are very well tested.</li>
<li>They provide a variety of functions for computations over the collections.</li>
<li>They define a few usage <em>protocols</em> that are flexible and powerful.</li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> As opposed to the dumbed-down versions found in Java, etc.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> As opposed to the dumbed-down versions found in Java, etc.</p>
</div>
<div class="slide">
<h1>Software Reuse (cont.)</h1>
@@ -586,7 +586,7 @@
case class CheckingAccount(customer: Customer, var balance: Money) extends Account
case class SavingsAccount(customer: Customer, var balance: Money,
var interestRate: Double) extends Account
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account.scala">code/bank-account.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account.scala">code/bank-account.scala</a></div></p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span>: An Example Problem (cont.)</h1>
@@ -609,7 +609,7 @@
// Checking: initial account: CheckingAccount(Customer(Dean),Money(1000.0))
// Checking: final account: CheckingAccount(Customer(Dean),Money(1500.0))
// Savings: initial account: SavingsAccount(Customer(Dean),Money(2000.0),0.02)
-// Checking: final account: SavingsAccount(Customer(Dean),Money(900.0),0.3)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-usage.scala">code/bank-account-usage.scala</a></div></p>
+// Checking: final account: SavingsAccount(Customer(Dean),Money(900.0),0.3)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-usage.scala">code/bank-account-usage.scala</a></div></p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span> and Modularity</h1>
@@ -631,7 +631,7 @@
_name = newName
putToDatabase("name", _name)
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-bad-persistence.scala">code/bank-account-bad-persistence.scala</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-bad-persistence.scala">code/bank-account-bad-persistence.scala</a></div></p>
</div>
<div class="slide">
<h1>Modularity Breakdown</h1>
@@ -657,10 +657,10 @@
</div>
<div class="slide">
<h1>Enterprise Java Beans</h1>
-<p><em>Enterprise Java Beans</em> (EJBs) where a flawed attempt to address this problem (the flaws were mostly fixed in the v3.0 redo<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>). This model let you specify some data for persistence, transactions, security, etc. in <span class="caps">XML</span> configuration files, but you still had very invasive code in your domain objects.</p>
+<p><em>Enterprise Java Beans</em> (EJBs) where a flawed attempt to address this problem (the flaws were mostly fixed in the v3.0 redo<sup class="footnote"><a href="#fn1">1</a></sup>). This model let you specify some data for persistence, transactions, security, etc. in <span class="caps">XML</span> configuration files, but you still had very invasive code in your domain objects.</p>
<p>Specifically, while the model &#8220;separated concerns&#8221; such as persistence from the domain model, the model objects needed to subclass <span class="caps">EJB</span> container types, implement methods to support lifecycle management, etc.</p>
<p>That is, EJBs traded one set of problems for another set.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> But only after the Spring Framework and the <span class="caps">AOP</span> community showed a better way.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> But only after the Spring Framework and the <span class="caps">AOP</span> community showed a better way.</p>
</div>
<div class="slide">
<h1>Aspect-Oriented Programming</h1>
@@ -688,9 +688,9 @@
<p>An aspect framework has two parts.</p>
<ul>
<li><strong>Quantification:</strong> The ability to specify, in a succinct way (programmatically or declaratively), which &#8220;points of execution&#8221; to observe or modify. It&#8217;s analogous to a query language over the set of execution points.</li>
- <li><strong>Behavior Modification</strong>: Once the set of execution points is identified, you need ways to observe or modify the behavior, <em>without modifying the original code</em><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>.</li>
+ <li><strong>Behavior Modification</strong>: Once the set of execution points is identified, you need ways to observe or modify the behavior, <em>without modifying the original code</em><sup class="footnote"><a href="#fn1">1</a></sup>.</li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> I.e., this a special case of the Expression Problem, a.k.a Open-Closed Principle.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> I.e., this a special case of the Expression Problem, a.k.a Open-Closed Principle.</p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span> Terminology</h1>
@@ -724,7 +724,7 @@
customer.name = newName
putToDatabase("name", newName)
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-instrumented.scala">code/bank-account-instrumented.scala</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-instrumented.scala">code/bank-account-instrumented.scala</a></div></p>
</div>
<div class="slide">
<h1><span class="caps">AOP</span> Tools</h1>
@@ -760,13 +760,13 @@
case None =&gt;
}
}
-}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-aspect.scala">code/bank-account-aspect.scala</a></div></p>
+}</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-aspect.scala">code/bank-account-aspect.scala</a></div></p>
</div>
<div class="slide">
<h1>Aspects Beyond Cross-Cutting Concerns</h1>
-<p>Note that the cross-cutting concerns that we mentioned, persistence, transactions, security, and logging, are sometimes called <em>non-functional requirements</em>, because they mostly relate to implementation concerns, rather than business requirements.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<p>Note that the cross-cutting concerns that we mentioned, persistence, transactions, security, and logging, are sometimes called <em>non-functional requirements</em>, because they mostly relate to implementation concerns, rather than business requirements.<sup class="footnote"><a href="#fn1">1</a></sup></p>
<p>Is this the only use for aspects?</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> This is not really an accurate distinction; everything we do is ultimately tied in some way to business requirements.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> This is not really an accurate distinction; everything we do is ultimately tied in some way to business requirements.</p>
</div>
<div class="slide">
<h1>Aspects Beyond Cross-Cutting Concerns</h1>
@@ -828,15 +828,15 @@
case class Customer(var name: String) extends Named
-val dean = new Customer("Dean") with PersistentName</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-mixin.scala">code/bank-account-mixin.scala</a></div></p>
+val dean = new Customer("Dean") with PersistentName</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/bank-account-mixin.scala">code/bank-account-mixin.scala</a></div></p>
</div>
<div class="slide">
<h1>Why Isn&#8217;t <span class="caps">AOP</span> Pervasive? (cont.)</h1>
<p>So we can get <em>advice</em> without aspects, although it&#8217;s still tedious to write all these special cases. However, we still don&#8217;t have <em>quantification</em>.</p>
<p>Functional data structures can address both limitations.</p>
<p>Objects are just ad hoc groupings of collections and &#8220;atoms&#8221; (numbers, strings, etc.), recursively. More specifically, they work like <em>maps</em> and in languages like JavaScript, they <em>are</em> maps!</p>
-<p>So, if we create a <code>PersistentMap</code><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>, in this case, and represent our objects as maps, we&#8217;ve solved the quantification problem!</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> In this case, meaning persistent to a database, not as in the <em><span class="caps">STM</span></em> case.</p>
+<p>So, if we create a <code>PersistentMap</code><sup class="footnote"><a href="#fn1">1</a></sup>, in this case, and represent our objects as maps, we&#8217;ve solved the quantification problem!</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> In this case, meaning persistent to a database, not as in the <em><span class="caps">STM</span></em> case.</p>
</div>
<div class="slide">
<h1>Why Isn&#8217;t <span class="caps">AOP</span> Pervasive? (cont.)</h1>
@@ -863,13 +863,13 @@
}
val dean = new HashMap[String,Any] with PersistentMap[String,Any]
-dean.put("name", "Dean")</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/persistent-map.scala">code/persistent-map.scala</a></div></p>
+dean.put("name", "Dean")</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/persistent-map.scala">code/persistent-map.scala</a></div></p>
</div>
<div class="slide">
<h1>Why Isn&#8217;t <span class="caps">AOP</span> Pervasive? (cont.)</h1>
<p>What this means is that if we just use <code>Maps</code> (and perhaps a few other fundamental collections), we can instrument them as needed with less effort than instrumenting lots of ad-hoc classes. The quantification problem is reduced.</p>
-<p>The key point here is that working with more &#8220;primitive&#8221; building blocks; functions, and core data structures, it is actually easier to <em>generate</em> the variations of behavior we need.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> We&#8217;ll return to this point in a few weeks when we talk about <em>simplicity</em> in systems, etc.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> We can make the behaviors more <em>composable</em> using advanced techniques like <em>monads</em>.</p>
+<p>The key point here is that working with more &#8220;primitive&#8221; building blocks; functions, and core data structures, it is actually easier to <em>generate</em> the variations of behavior we need.<sup class="footnote"><a href="#fn1">1</a></sup> We&#8217;ll return to this point in a few weeks when we talk about <em>simplicity</em> in systems, etc.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> We can make the behaviors more <em>composable</em> using advanced techniques like <em>monads</em>.</p>
</div>
<div class="slide">
<h1>Conclusions: <span class="caps">OOP</span> vs. FP (vs. <span class="caps">AOP</span>)</h1>
View
33 PragmaticsOfIndustrialSWDevelopment/html/lecture12.html
@@ -220,9 +220,9 @@
</div>
<div class="slide">
<h1>Waterfall Model of Software Development</h1>
-<p>The Waterfall Process resulted from a historical accident.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> During the 60s, many researches recognized the importance of iterative development. One paper was &#8220;Managing the Development of Large Software Systems&#8221;, by Winston Royce, in Proceedings of <span class="caps">IEEE</span> Westcon.</p>
+<p>The Waterfall Process resulted from a historical accident.<sup class="footnote"><a href="#fn1">1</a></sup> During the 60s, many researches recognized the importance of iterative development. One paper was &#8220;Managing the Development of Large Software Systems&#8221;, by Winston Royce, in Proceedings of <span class="caps">IEEE</span> Westcon.</p>
<p>This paper started with an image similar to the one two slides ago, <em>but</em> it went on to argue that such a process <em>can&#8217;t work</em>, because feedback is required.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> Craig Larman, &#8220;Agile and Iterative Development: A Manager&#8217;s Guide&#8221;, pp 102-107.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> Craig Larman, &#8220;Agile and Iterative Development: A Manager&#8217;s Guide&#8221;, pp 102-107.</p>
</div>
<div class="slide">
<h1>Waterfall Model of Software Development</h1>
@@ -337,7 +337,7 @@
<table>
<tr>
<th>Name </th>
- <th>Agile &#8220;School&#8221;<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> </th>
+ <th>Agile &#8220;School&#8221;<sup class="footnote"><a href="#fn1">1</a></sup> </th>
</tr>
<tr>
<td> Kent Beck </td>
@@ -361,7 +361,7 @@
</tr>
<tr>
<td> Martin Fowler </td>
- <td> Consultant<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td>
+ <td> Consultant<sup class="footnote"><a href="#fn2">2</a></sup> </td>
</tr>
<tr>
<td> James Grenning </td>
@@ -372,8 +372,8 @@
<td> Adaptive Software Development </td>
</tr>
</table>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
-<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
+<sup class="footnote"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
</div>
</div>
<div class="slide">
@@ -382,11 +382,11 @@
<table>
<tr>
<th>Name </th>
- <th>Agile &#8220;School&#8221;<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> </th>
+ <th>Agile &#8220;School&#8221;<sup class="footnote"><a href="#fn1">1</a></sup> </th>
</tr>
<tr>
<td> Andrew Hunt </td>
- <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td>
+ <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote"><a href="#fn2">2</a></sup> </td>
</tr>
<tr>
<td> Ron Jeffries </td>
@@ -418,22 +418,23 @@
</tr>
<tr>
<td> Dave Thomas </td>
- <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td>
+ <td> Consultant, co-owner of the Pragmatic Programmers<sup class="footnote"><a href="#fn2">2</a></sup> </td>
</tr>
</table>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
-<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> The &#8220;named&#8221; Agile methodology this person is most associated with, at least at the time the manifesto was drafted.<br />
+<sup class="footnote"><a href="#fn2">2</a></sup> Not involved in the invention of any particular &#8220;named&#8221; Agile methodology.</p>
</div>
</div>
<div class="slide">
-<h1>Three Agile Methods: Scrum, XP, and Lean</h1>
-<p>While there are several different agile methods mentioned, we&#8217;ll discuss the three most popular.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<h1>Three Agile Methods: Scrum, XP, and Lean<br />
+ <br />
+While there are several different agile methods mentioned, we&#8217;ll discuss the three most popular.<sup class="footnote"><a href="#fn1">1</a></sup></h1>
<ul>
<li><strong>Scrum</strong> &#8211; focuses on project management.</li>
<li><strong>XP</strong> &#8211; a complete, small-team approach, addressing project management and developer practices.</li>
<li><strong>Lean</strong> &#8211; inspired by Toyota Lean, &#8220;Just-in-Time&#8221; Manufacturing.</li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> See Highsmith&#8217;s &#8220;Agile Software Development Ecosystems&#8221; for an excellent survey of the major agile methods (in 2002).</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> See Highsmith&#8217;s &#8220;Agile Software Development Ecosystems&#8221; for an excellent survey of the major agile methods (in 2002).</p>
</div>
<div class="slide">
<h1>Three Agile Methods: Scrum, XP, and Lean</h1>
@@ -451,7 +452,7 @@
<img src="images/800px-Scrum_process.png"></img>
</center>
<div class='small cite'>
-<p>(source: <a href="http://en.wikipedia.org/wiki/Scrum_(development)">Wikipedia</a>)</p>
+<p>(source: <a href="http://en.wikipedia.org/wiki/Scrum_(development">Wikipedia</a>))</p>
</div>
</div>
<div class="slide">
@@ -771,7 +772,7 @@
<h1>Reading Assignment (cont.)</h1>
<p>Last week, I had you read some general introductions to Agile. This week, I want you read about the three main Agile methodologies that we discussed today.</p>
<ul>
- <li><a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a>.</li>
+ <li><a href="http://en.wikipedia.org/wiki/Scrum_(development">Scrum</a>).</li>
<li><a href="http://en.wikipedia.org/wiki/Extreme_Programming">Extreme Programming</a>. Focus especially on the sections that describe the Values, Principles, and Practices.</li>
<li><a href="http://en.wikipedia.org/wiki/Lean_software_development">Lean Software Development</a>.</li>
</ul>
View
17 PragmaticsOfIndustrialSWDevelopment/html/lecture2.html
@@ -285,7 +285,7 @@
counter // -&gt; 1
counter // -&gt; 2
-ref.get // -&gt; 2 (retrieve the value explicitly)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example1.scala">code/akka-stm-example1.scala</a></div></p>
+ref.get // -&gt; 2 (retrieve the value explicitly)</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example1.scala">code/akka-stm-example1.scala</a></div></p>
</div>
<div class="slide">
<h1>Symantics (cont.)</h1>
@@ -300,7 +300,7 @@
atomic {
ref set 10 // set new value
} // (actually returns old value)
-ref.get // -&gt; 10</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example2.scala">code/akka-stm-example2.scala</a></div></p>
+ref.get // -&gt; 10</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example2.scala">code/akka-stm-example2.scala</a></div></p>
</div>
<div class="slide">
<h1>Symantics: Blocking (&#8220;Retry&#8221;)</h1>
@@ -321,7 +321,7 @@
to alter (_ + amount)
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example3.scala">code/akka-stm-example3.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example3.scala">code/akka-stm-example3.scala</a></div></p>
<p>(See <strong>Blocking Transactions</strong> on the <a href="http://doc.akkasource.org/stm-scala">Akka <span class="caps">STM</span> page</a> for the full example.)</p>
</div>
<div class="slide">
@@ -346,7 +346,7 @@
}
}
}
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example4.scala">code/akka-stm-example4.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/akka-stm-example4.scala">code/akka-stm-example4.scala</a></div></p>
</div>
<div class="slide">
<h1>Composability and Modularity</h1>
@@ -469,7 +469,7 @@
<div class="code-tiny">
<pre name="code" id="code" class="brush: scala;">[error] Test Failed: calculateStatistics returns a JSON string containing all data that matches the instrument criteria
org.scalatest.TestFailedException: JObject(List(JField(criteria,JObject(List(JField(instruments,JArray(List(JString(A)))), JField(statistics,JArray(List(JString(price[$])))), JField(start,JInt(0)), JField(end,JInt(1283824964864))))), JField(results,JArray(List(JObject(List(JField(timestamp,JInt(1283824954864)), JField(symbol,JString(A)), JField(price,JDouble(0.0)))), JObject(List(JField(timestamp,JInt(1283824955864)), JField(symbol,JString(C)), JField(price,JDouble(10.0)))), JObject(List(JField(timestamp,JInt(1283824956864)), JField(symbol,JString(A)), JField(price,JDouble(20.0)))), JObject(List(JField(timestamp,JInt(1283824957864)), JField(symbol,JString(B)), JField(price,JDouble(30.0)))), JObject(List(JField(timestamp,JInt(1283824958864)), JField(symbol,JString(A)), JField(price,JDouble(40.0))))))))) did not equal JObject(List(JField(criteria,JObject(List(JField(instruments,JArray(List(JString(A)))), JField(statistics,JArray(List(JString(price[$])))), JField(start,JInt(0)), JField(end,JInt(1283824964864))))), JField(results,JArray(List(JObject(List(JField(timestamp,JInt(1283824954864)), JField(symbol,JString(A)), JField(price,JDouble(0.0)))), JObject(List(JField(timestamp,JInt(1283824958864)), JField(symbol,JString(A)), JField(price,JDouble(40.0)))), JObject(List(JField(timestamp,JInt(1283824956864)), JField(symbol,JString(A)), JField(price,JDouble(20.0)))))))))
-</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/deanwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/exercise1-test-failure.scala">code/exercise1-test-failure.scala</a></div></p>
+</pre><p></div><div class="codeurl"><a href="txmt://open?url=file:///Users/dwampler/projects/Loyola/COMP388-488/Presentations/PragmaticsOfIndustrialSWDevelopment/code/exercise1-test-failure.scala">code/exercise1-test-failure.scala</a></div></p>
<p>(Yeah!)</p>
</div>
<div class="slide">
@@ -499,10 +499,11 @@
<p><code>~test-only org.chicagoscala.awse.server.finance.InstrumentAnalysisServerTest</code></p>
<ul>
<li>Note that it will wait (no prompt is returned) and every time you save code changes, this test will run.</li>
- <li>Using the <code>~test-only</code> &#8220;action&#8221; saves time, running in a few seconds, while running all the tests takes longer.</li>
+ <li>Using the <code>~test-only</code> &#8220;action&#8221; saves time, running in a few seconds, while running all the tests takes longer.<br />
+ <br />
+</div><br />
+<div class="slide"></li>
</ul>
-</div>
-<div class="slide">
<h1>Add New Functionality (cont.)</h1>
<ul>
<li>Now, in your editor of choice, open the file <code>main/scala/server/finance/InstrumentAnalysisServer.scala</code> (the file being tested&#8230;)</li>
View
12 PragmaticsOfIndustrialSWDevelopment/html/lecture3.html
@@ -419,8 +419,9 @@
<div class="slide">
<h1>Tightly Coupled (Clustered)</h1>
<p>Usually refers to a cluster of servers or services that collaborate closely, perhaps to solve a problem with <em>divide and conquer</em> after which the individual contributions are combined to produce the final result.</p>
-<p>Tight coupling may imply that failure of one element causes the work of all elements to fail. An exception is typical <em>map-reduce</em> systems (which we&#8217;ll discuss in a subsequent lecture), like <em>Hadoop</em>, which handle single node failures.</p>
-<p>Example:</p>
+<p>Tight coupling may imply that failure of one element causes the work of all elements to fail. An exception is typical <em>map-reduce</em> systems (which we&#8217;ll discuss in a subsequent lecture), like <em>Hadoop</em>, which handle single node failures.<br />
+ <br />
+Example:</p>
<ul>
<li>Multicore Processor</li>
<li>Map-Reduce</li>
@@ -518,10 +519,11 @@
<li>Edit <code>RestfulDataPublisher.scala</code>. We need to do a little <em>refactoring</em> first.</li>
<li>Change <code>getStatsFromInstrumentAnalysisServerSupervisors</code> to take this argument: <code>message: InstrumentCalculationMessages</code>.</li>
<li>Change <code>supervisor !! CalculateStatistics(allCriteria)</code> to <code>supervisor !! message</code>.</li>
- <li>Now this method is more general to meet our needs.</li>
+ <li>Now this method is more general to meet our needs.<br />
+ <br />
+</div><br />
+<div class="slide"></li>
</ul>
-</div>
-<div class="slide">
<h1>Add New Functionality (step 6)</h1>
<ul>
<li>Also in <code>RestfulDataPublisher.scala</code>, in method <code>getAllDataFor</code>, change:</li>
View
9 PragmaticsOfIndustrialSWDevelopment/html/lecture4.html
@@ -404,8 +404,9 @@
</div>
<div class="slide">
<h1>Key-Value Stores</h1>
-<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, MNesia.</em></p>
-<p>Think of hash maps on <em>steroids</em>.</p>
+<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, MNesia.</em><br />
+ <br />
+Think of hash maps on <em>steroids</em>.</p>
<ul>
<li>May be purely in-memory (with optional flushing to disk) and resident on one machine.</li>
<li>Excellent for &#8220;persisting&#8221; semi-structured data with shorter lifespans (e.g., web sessions).</li>
@@ -439,9 +440,9 @@
</div>
<div class="slide">
<h1>&#8220;Polyglot Persistence&#8221;</h1>
-<p>A big trend today is that non-trivial systems mix different programming languages, libraries and tools. Do we use just one language to write all parts of a standard web application? No.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
+<p>A big trend today is that non-trivial systems mix different programming languages, libraries and tools. Do we use just one language to write all parts of a standard web application? No.<sup class="footnote"><a href="#fn1">1</a></sup></p>
<p>The same phenomenon is now happening at the persistence level. Often, one persistence strategy doesn&#8217;t fit all needs in complex, distributed systems. You might use a fast, key-value store for user sessions, then persist key &#8220;events&#8221; to an <span class="caps">RDBMS</span>, for example.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> Well, maybe we could with JavaScript&#8230;</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> Well, maybe we could with JavaScript&#8230;</p>
</div>
<div class="slide">
<h1>Some Techniques We&#8217;ll Discuss</h1>
View
5 PragmaticsOfIndustrialSWDevelopment/html/lecture5.html
@@ -195,8 +195,9 @@
</div>
<div class="slide">
<h1>Key-Value Stores</h1>
-<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, Mnesia.</em></p>
-<p>Think of hash maps on <em>steroids</em>.</p>
+<p>E.g., <em>Amazon SimpleDB, Riak, Redis, Tokyo Cabinet, Scalaris, MemcacheDB, BerkeleyDB, Mnesia.</em><br />
+ <br />
+Think of hash maps on <em>steroids</em>.</p>
<ul>
<li>May be purely in-memory (with optional flushing to disk) and resident on one machine.</li>
<li>Excellent for &#8220;persisting&#8221; semi-structured data with shorter lifespans (e.g., web sessions).</li>
View
5 PragmaticsOfIndustrialSWDevelopment/html/lecture6.html
@@ -127,9 +127,10 @@
<li>To hard to do this manually.</li>
<li>Keys are hashed, using consistent hashing.</li>
<li>The range of possible hash values is treated as a &#8220;ring&#8221; that wraps.</li>
- <li>Each node is assigned a random position on the ring.</li>
+ <li>Each node is assigned a random position on the ring.<br />
+ <br />
+When a row&#8217;s key is hashed, the node with the closest key <em>greater than</em> the row&#8217;s key is assigned the responsibility for coordinating reads and writes.</li>
</ul>
-<p>When a row&#8217;s key is hashed, the node with the closest key <em>greater than</em> the row&#8217;s key is assigned the responsibility for coordinating reads and writes.</p>
</div>
<div class="slide">
<h1>Reads and Writes</h1>
View
33 PragmaticsOfIndustrialSWDevelopment/html/lecture8.html
@@ -215,15 +215,15 @@
<ul>
<li>Once a constructor completes, the object should be in a <em>known-good state</em>.</li>
<li><em>Every</em> method should transition the object from one known-good state to another (possibly the same) known-good state.</li>
- <li>Clean up resources when the object becomes garbage.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> <sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup></li>
+ <li>Clean up resources when the object becomes garbage.<sup class="footnote"><a href="#fn1">1</a></sup> <sup class="footnote"><a href="#fn2">2</a></sup></li>
</ul>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> C++ and C# have <em>destructors</em> for this purpose (but they may be invoked too late for some resources, like database connections).<br />
-<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> Java has finalizers, but they are effectively useless, maybe even harmful.</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> C++ and C# have <em>destructors</em> for this purpose (but they may be invoked too late for some resources, like database connections).<br />
+<sup class="footnote"><a href="#fn2">2</a></sup> Java has finalizers, but they are effectively useless, maybe even harmful.</p>
</div>
<div class="slide">
-<h1>Design by Contract<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></h1>
+<h1>Design by Contract<sup class="footnote"><a href="#fn1">1</a></sup></h1>
<p><a href="http://en.wikipedia.org/wiki/Design_by_contract">Design by Contract</a> (DbC) is a programming discipline where you specify assertions about program behavior that the language infrastructure can enforce during testing, but disable in production deployments, for performance reasons.</p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> A registered trademark of Eiffel Software</p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> A registered trademark of Eiffel Software</p>
</div>
<div class="slide">
<h1>Design by Contract (cont.)</h1>
@@ -238,8 +238,9 @@
<div class="slide">
<h1>Preconditions</h1>
<p><strong>Preconditions</strong> are what must be true in order for the function to do its job. A trivial example: there must be enough free memory for the function to allocate the objects it creates.</p>
-<p>Hence, these are requirements on the runtime environment and the clients using the function. Here is an example using our Windowing <span class="caps">API</span> and a &#8220;mythical&#8221; DbC framework that uses annotations.</p>
-<div class="code-small">
+<p>Hence, these are requirements on the runtime environment and the clients using the function. Here is an example using our Windowing <span class="caps">API</span> and a &#8220;mythical&#8221; DbC framework that uses annotations.<br />
+ <br />
+<div class="code-small"></p>
<pre name="code" id="code" class="brush: scala,;">
package gui.windowing {
@@ -255,8 +256,9 @@
<div class="slide">
<h1>Postconditions</h1>
<p><strong>Postconditions</strong> are what the function guarantees to satisfy when it finishes its job, <em>if</em> the preconditions are true. A trivial example: a function might promise to never return <code>null</code>.</p>
-<p>Hence, these are requirements on the function itself, constituting promises to clients. Here is an example using our Windowing <span class="caps">API</span>.</p>
-<div class="code-small">
+<p>Hence, these are requirements on the function itself, constituting promises to clients. Here is an example using our Windowing <span class="caps">API</span>.<br />
+ <br />
+<div class="code-small"></p>
<pre name="code" id="code" class="brush: scala,;">
package gui.windowing {
@@ -272,8 +274,9 @@
</div>
<div class="slide">
<h1>Invariants</h1>
-<p><strong>Invariants</strong> must be true before and after function invocation. They may specify some object (or global) property that doesn&#8217;t change. They may specify a logical constraint that must remain true, etc. Invariants can be requirements on the function, the environment, or both.</p>
-<div class="code-small">
+<p><strong>Invariants</strong> must be true before and after function invocation. They may specify some object (or global) property that doesn&#8217;t change. They may specify a logical constraint that must remain true, etc. Invariants can be requirements on the function, the environment, or both.<br />
+ <br />
+<div class="code-small"></p>
<pre name="code" id="code" class="brush: scala,;">
package gui.windowing {
@@ -312,7 +315,6 @@
<h1>Scala Has Classes (for Example)</h1>
<p>Scala example, patterned after Java&#8217;s <code>Exception</code> Hierarchy:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
class Exception(
@@ -483,7 +485,6 @@
<p><em>Prototype-based languages</em> don&#8217;t have classes. (Hence they are also called <em>classless</em> languages.) Instead, you just build up objects &#8220;from scratch&#8221;.</p>
<p>JavaScript object-literal notation (essentially, a hash map):<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
var exception = {
@@ -508,8 +509,8 @@
<div class="slide">
<h1>Aside: <em>Open Classes</em></h1>
<p>Note that many <em>dynamically-typed, class-based</em> languages, e.g., Ruby, allow this kind of object modification, too. They are said to have <em>open classes</em>.</p>
-<p>Most <em>statically-typed</em> languages, like Scala, Java, C#, and C++, have closed classes. You can&#8217;t add or remove members in objects.<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></p>
-<p><sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> There are some workarounds, both byte-code level hacks and some language features, like Scala&#8217;s <em>implicits</em>.</p>
+<p>Most <em>statically-typed</em> languages, like Scala, Java, C#, and C++, have closed classes. You can&#8217;t add or remove members in objects.<sup class="footnote"><a href="#fn1">1</a></sup></p>
+<p><sup class="footnote"><a href="#fn1">1</a></sup> There are some workarounds, both byte-code level hacks and some language features, like Scala&#8217;s <em>implicits</em>.</p>
</div>
<div class="slide">
<h1>Prototype-Based Languages (cont.)</h1>
@@ -695,7 +696,6 @@
<h1><code>Option[+A]</code>: <code>case</code> class (cont.)</h1>
<p>So, adding <code>case</code> to the declaration is equivalent to this:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
final class Some[+A](val x: A) extends Option[+A] {
@@ -730,7 +730,6 @@
<p><strong>Nothing</strong>: A subtype of <em>all</em> other types, with <em>no</em> instances.</p>
<p>Used for proper type safety.<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
case object None extends Option[Nothing] {...}
View
7 PragmaticsOfIndustrialSWDevelopment/html/lecture9.html
@@ -218,8 +218,9 @@
</div>
<div class="slide">
<h1>Uniform-Access Principle (cont.)</h1>
-<p>The <em>caller</em> doesn&#8217;t care whether a method is invoked or a bare field is accessed.</p>
-<p>The <em>implementer</em> might want to start with a simple bare field access, then eventually replace it with a method call (e.g., to do lazy initialization, etc.).</p>
+<p>The <em>caller</em> doesn&#8217;t care whether a method is invoked or a bare field is accessed.<br />
+ <br />
+The <em>implementer</em> might want to start with a simple bare field access, then eventually replace it with a method call (e.g., to do lazy initialization, etc.).</p>
<p>The <em>uniform-access principle</em> means the caller&#8217;s code doesn&#8217;t have to change, because the syntax is identical. (The code might need a recompile).</p>
</div>
<div class="slide">
@@ -326,7 +327,6 @@
<h1>Other Modules</h1>
<p><span class="caps">BAD</span>:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
object MyApp {
@@ -338,7 +338,6 @@
</pre></div>
<p><span class="caps">GOOD</span>:<br />
<div class="code-small"></p>
-
<pre name="code" id="code" class="brush: scala,;">
object MyApp {
View
2  PragmaticsOfIndustrialSWDevelopment/html/table_of_contents.html
@@ -102,7 +102,7 @@
<div class="slide">
<h1>Lecture 8: Recent Advances in Object-Oriented Programming (<span class="caps">OOP</span>)</h1>
<ul>
- <li><a href="lecture8.html" title="OOP">Lecture 8: Recent Advances in Object-Oriented Programming</a></li>
+ <li><a href="lecture8.html" title="&lt;span class=&quot;caps&quot;&gt;OOP&lt;/span&gt;">Lecture 8: Recent Advances in Object-Oriented Programming</a></li>
</ul>
</div>
<div class="slide">
Please sign in to comment.
Something went wrong with that request. Please try again.