Author: rahul
Date: Wed Mar  1 07:53:58 2006
New Revision: 382066

URL: http://svn.apache.org/viewcvs?rev=382066&view=rev
Log:
BZ 38274 [scxml] Write Use Case for Stand-alone Application Modelling a Stop 
Watch

Added:
    jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml   
(with props)
Modified:
    jakarta/commons/sandbox/scxml/trunk/xdocs/navigation.xml
    jakarta/commons/sandbox/scxml/trunk/xdocs/usecases.xml

Modified: jakarta/commons/sandbox/scxml/trunk/xdocs/navigation.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/xdocs/navigation.xml?rev=382066&r1=382065&r2=382066&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/xdocs/navigation.xml (original)
+++ jakarta/commons/sandbox/scxml/trunk/xdocs/navigation.xml Wed Mar  1 
07:53:58 2006
@@ -51,6 +51,9 @@
                   href="/usecases.html"
                   collapse="true">
 
+        <item     name="SCXML Stopwatch"
+                  href="/usecases/scxml-stopwatch.html" />
+
         <item     name="SCXML in RDC group container"  
                   href="/usecases/scxml-in-rdc-group.html" />
 

Modified: jakarta/commons/sandbox/scxml/trunk/xdocs/usecases.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/xdocs/usecases.xml?rev=382066&r1=382065&r2=382066&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/xdocs/usecases.xml (original)
+++ jakarta/commons/sandbox/scxml/trunk/xdocs/usecases.xml Wed Mar  1 07:53:58 
2006
@@ -37,23 +37,36 @@
    that can be represented as a UML state chart, for example, business process 
    flows, view navigation bits, interaction or dialog management etc. (this is,
    by no means, a comprehensive list), can leverage the Commons SCXML engine
-   library. We illustrate just a few sample usecases within frameworks in the
-   open source community as illustrations.
+   library. We illustrate just a few sample usecases as illustrations.
    </p>
   </subsection>
 
   <subsection name="Samples">
-   <p>
-    <ul>
-     <li><a href="usecases/scxml-in-rdc-group.html">Usecase 1</a> - Use in 
-     <a href="http://jakarta.apache.org/taglibs/doc/rdc-doc/intro.html";>
-     Reusable Dialog Components (RDC) Framework</a> &lt;group&gt;
-     container.</li>
-     <li><a href="usecases/scxml-in-shale-dialogs.html">Usecase 2</a> -
-     Use in <a href="http://struts.apache.org/shale";>Shale</a> dialogs</li>
-    </ul>
-   </p>
-   <br/>
+   <p>Simple usecases, and beyond:</p>
+   <subsection name="Simple">
+    <p>These are "standalone" usecases, which do not require any knowledge
+       beyond beginner Java and beginner XML.
+       <ul>
+        <li><a href="usecases/scxml-stopwatch.html">Usecase 1</a> -
+        Using Commons SCXML to model and implement behavior of stateful
+        objects (SCXML stopwatch example).</li>
+       </ul>
+    </p>
+   </subsection>
+   <subsection name="Advanced">
+    <p>These are usecases within frameworks available in the open source
+       community, and are labeled advanced since they require some additional
+       knowledge about the framework relevant to the particular usecase.
+       <ul>
+        <li><a href="usecases/scxml-in-rdc-group.html">Usecase 2</a> - Use in
+        <a href="http://jakarta.apache.org/taglibs/doc/rdc-doc/intro.html";>
+        Reusable Dialog Components (RDC) Framework</a> &lt;group&gt;
+        container.</li>
+        <li><a href="usecases/scxml-in-shale-dialogs.html">Usecase 3</a> -
+        Use in <a href="http://struts.apache.org/shale";>Shale</a> dialogs</li>
+       </ul>
+    </p>
+   </subsection>
    <p>If you know of another usecase we should list or if you are interesting
    in seeing if SCXML fits a usecase you have in mind, contact us via the
    <a href="mail-lists.html">mailing lists</a>.

Added: jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml?rev=382066&view=auto
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml 
(added)
+++ jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml Wed 
Mar  1 07:53:58 2006
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright 2006 The Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<document>
+
+ <properties>
+  <title>Commons SCXML Usecases - Stopwatch</title>
+  <author email="commons-dev@jakarta.apache.org">Commons Documentation 
Team</author>
+ </properties>
+
+ <body>
+
+  <section name="Using SCXML documents to define behavior">
+   
+   <p>SCXML documents (more generically, UML state chart diagrams) can be used
+      to define stateful behavior of objects, and Commons SCXML enables
+      developers to take this model directly into the corresponding code
+      artifacts. The resulting artifacts tend to be much simpler, embody a
+      useful separation of concerns and are easier to understand and maintain.
+   </p>
+
+   <subsection name="Motivation">
+    <ul>
+     <li>Demonstrate a "standalone" usecase of Commons SCXML
+         (some of the other usecases are "frameworky" in nature and require
+         additional knowledge of the framework the particular usecase
+         refers to).</li>
+     <li>Demonstrate the useful separation of concerns, the
+         simplicity of the resulting artifacts, and the direct association
+         between the model and the code when using Commons SCXML to
+         incorporate behavior.</li>
+    </ul>
+   </subsection>
+
+  </section>
+
+  <section name="Sample walkthrough - From model to working code">
+
+   <p>Here is a short exercise in modeling and implementing an object with
+      stateful behavior. A stopwatch -- for anyone who may need an introduction
+      -- is used to measure duration, with one button for starting and stopping
+      the watch and another one for pausing the display (also known as "split",
+      where the watch continues to keep time while the display is frozen, to
+      measure, for example, "lap times" in races). Once the watch has been
+      stopped, the start/stop button may be used to reset the display.
+   </p>
+
+   <subsection name="The Model - UML Diagram">
+    <p>Here is the state chart diagram that describes the behavior
+       of this particular stopwatch:<br/>
+       <a href="scxml-stopwatch/stopwatch.jpg"><img
+          src="scxml-stopwatch/stopwatch.jpg" border="0"
+          alt="stopwatch state chart diagram"/></a><br/>
+       (<a href="scxml-stopwatch/stopwatch-model.jpg">Zoom out</a>)
+    </p>
+   </subsection>
+
+   <subsection name="The SCXML document">
+    <p>The SCXML document is then, a simple serialization of
+       the "model" above:
+       <a 
href="http://svn.apache.org/repos/asf/jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/env/stopwatch.xml";>stopwatch.xml</a>.
+    </p>
+   </subsection>
+
+   <subsection name="The Stopwatch class">
+    <p>Here is the class that implements the stopwatch behavior,
+       <a 
href="../xref-test/org/apache/commons/scxml/env/StopWatch.html">StopWatch.java</a>.
+       The class extends
+       <a 
href="../xref/org/apache/commons/scxml/env/AbstractStateMachine.html">AbstractStateMachine.java</a>,
+       which provides one approach for providing the base functionality
+       needed by classes representing stateful entities. Points to note
+       in the StopWatch class are:
+       <ul>
+        <li>The "lifecycle" is defined by the SCXML document, which is
+            an artifact easily derived from the modeling layer.</li>
+        <li>The code is much simpler, since the lifecycle management
+            task has been assigned to Commons SCXML.</li>
+       </ul>
+    </p>
+   </subsection>
+
+   <subsection name="The Stopwatch UI">
+    <p>Here is the UI for our demonstration,
+       <a 
href="../xref-test/org/apache/commons/scxml/env/StopWatchDisplay.html">StopWatchDisplay.java</a>.
+       Points to note here are:
+       <ul>
+        <li>The UI is "backed" by a StopWatch instance.</li>
+        <li>It merely relays the user initiated events (in this case,
+            button clicks) to the Commons SCXML driven StopWatch
+            instance by serving as an intermediary / proxy.</li>
+        <li>The UI and application behavior separation is thus, and
+            usefully, pronounced.</li>
+       </ul>
+    </p>
+   </subsection>
+
+  </section>
+
+ </body>
+
+</document>

Propchange: 
jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jakarta/commons/sandbox/scxml/trunk/xdocs/usecases/scxml-stopwatch.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to