home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / index-old.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  16.9 KB  |  354 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "document-v10.dtd">
  18.  
  19. <document>
  20.  <header>
  21.   <title>Apache Cocoon</title>
  22.   <subtitle>XML Publishing Framework</subtitle>
  23.   <authors>
  24.    <person name="Stefano Mazzocchi" email="stefano@apache.org"/>
  25.   </authors>
  26.  </header>
  27.  
  28.  <body>
  29.  <s1 title="What is it?">
  30.   <figure src="images/cocoon.gif" alt="Cocoon"/>
  31.   <p>
  32.    Apache Cocoon is an XML publishing framework that raises the usage of
  33.    XML and XSLT technologies for server applications to a new
  34.    level. Designed for performance and scalability around pipelined SAX
  35.    processing, Cocoon offers a flexible environment based on the separation
  36.    of concerns between content, logic and style. A centralized
  37.    configuration system and sophisticated caching top this all off and help
  38.    you to create, deploy and maintain rock-solid XML server applications.
  39.   </p>
  40.   <p>
  41.    Cocoon interacts with most data sources, including: filesystems, RDBMS,
  42.    LDAP, native XML databases, and network-based data sources. It adapts
  43.    content delivery to the capabilities of different devices like HTML, WML,
  44.    PDF, SVG, RTF just to name a few. Cocoon currently runs as a Servlet or
  45.    from a powerful commandline interface. The chosen design of an abstracted
  46.    environment gives you the freedom to implement your own concrete
  47.    environment to suit your required functionality.
  48.   </p>
  49.     <p>
  50.    This documentation is not complete because documentation is never complete anyway. However the current
  51.    release is stable and tested thoroughly and you'll find lots of samples which show and explain 
  52.    the power of Apache Cocoon 2.1.5.1. We welcome you into this new world of XML wonders :-)
  53.   </p>
  54.  <p>
  55.    Technologies like Extensible Server Pages (XSP) and the Action framework gives 
  56.    you all the power to add your own logic into the building process of your resources 
  57.    and services you want Cocoon to be able to perform.
  58.   </p> 
  59.  </s1>
  60.   <s1 title="Where is it?">
  61.    <p>
  62.    If you want to download the latest release of Apache Cocoon just go to the 
  63.    <link href="http://cocoon.apache.org/mirror.cgi">download area</link>.
  64.    </p>
  65.   <p>
  66.    Apache Cocoon 2.1.5.1 is the latest release of the XML publishing framework.
  67.    If you are looking for Cocoon 1 go <link href="http://cocoon.apache.org/1.x/">here</link>.
  68.   </p>
  69.   </s1>
  70.  <s1 title="Introduction">
  71.   <p>The Cocoon Project has gone a long way since its creation on
  72.   January 1999. It started as a simple servlet for static XSL styling and became
  73.   more and more powerful as new features were added. Unfortunately, design
  74.   decisions made early in the project influenced its evolution. Today, some of
  75.   those constraints that shaped the project were modified as XML standards have evolved and
  76.   solidified. For this reason, those design decisions need to be reconsidered
  77.   under this new light.</p>
  78.  
  79.   <p>While Cocoon started as a small step in the direction of a new
  80.   web publishing idea based on better design patterns and reviewed estimations
  81.   of management issues, the technology used was not mature enough for tools to
  82.   emerge. Today, most web engineers consider XML as the key for an improved web
  83.   model and web site managers see XML as a way to reduce costs and ease
  84.   production.</p>
  85.  
  86.   <p>In an era where services rather than software will be key for
  87.   economic success, a better and less expensive model for web publishing will
  88.   be a winner, especially if based on open standards.</p>
  89.  </s1>
  90.  
  91.  <s1 title="Passive APIs vs. Active APIs">
  92.   <p>Web serving environments must be fast and scalable to be
  93.   useful. Cocoon 1 was born as a "proof of concept" rather than
  94.   production software and had significant design restrictions, based mainly on
  95.   the availability of freely redistributable tools. Other issues were lack of
  96.   detailed knowledge on the APIs available as well as underestimation of the
  97.   project success, being created as a way to learn XSL rather than a full
  98.   publishing system capable of taking care of all XML web publishing needs.</p>
  99.  
  100.   <p>For the above reasons, Cocoon 1 was based on the DOM level 1
  101.   API which is a <em>passive</em> API and was intended mainly for client side
  102.   operation. This is mainly due to the fact that most DOM
  103.   implementations require the document to reside in memory. While this is
  104.   practical for small documents and thus good for the "proof of
  105.   concept" stage, it is now considered a main design constraint for Cocoon
  106.   scalability.</p>
  107.  
  108.   <p>Since the goal of Cocoon is the ability to process
  109.   simultaneously multiple 100Mb documents in JVM with a few Mbs of heap size,
  110.   careful memory use and tuning of internal components is a key issue. To reach
  111.   this goal, an improved API model was needed. This is now identified in the SAX
  112.   API which is, unlike DOM, event based (so <em>active</em>, in the sense that its
  113.   design is based on the <em>inversion of control</em> principle).</p>
  114.  
  115.   <p>The event model allows document generators to trigger events that get handled
  116.   by the various processing stages and finally get
  117.   serialized onto the response stream. This has a significant impact on both
  118.   performance (effective and user perceived) and memory needs:</p>
  119.  
  120.   <dl>
  121.     <dt>Incremental operation</dt>
  122.     <dd>
  123.       The response is created during document production.
  124.       Client's perceived performance is dramatically
  125.       improved since clients can start receiving data as soon as it is created,
  126.       not after all processing stages have been performed. In those cases where
  127.       incremental operation is not possible (for example, element sorting),
  128.       internal buffers store the events until the operation can be performed.
  129.       However, even in these cases performance can be increased with the use of
  130.       tuned memory structures.
  131.     </dd>
  132.     <dt>Lowered memory consumption</dt>
  133.     <dd>
  134.       Since most of the
  135.       server processing required in Cocoon is incremental, an incremental model
  136.       allows XML production events to be transformed directly into output events
  137.       and character written on streams, thus avoiding the need to store them in
  138.       memory.
  139.     </dd>
  140.     <dt>Easier scalability</dt>
  141.     <dd>
  142.       Reduced memory needs allow a greater number of
  143.       concurrent operations to take place simultaneously, thus allowing the
  144.       publishing system to scale as the load increases.
  145.     </dd>
  146.     <dt>More optimizable code model</dt>
  147.     <dd>
  148.       Modern virtual machines are based on the idea of <em>hotspots</em>,
  149.       code fragments that are used often and, if optimized, increase the process
  150.       execution speed by large amounts.
  151.       This new event model allows easier detection of hotspots since it is a
  152.       method driven operation, rather than a memory driven one. Hot methods can
  153.       be identified earlier and can be better optimized.
  154.     </dd>
  155.     <dt>Reduced garbage collection</dt>
  156.     <dd>
  157.       Even the most advanced
  158.       and lightweight DOM implementation require at least three to five times
  159.       (and sometimes much more than this) more memory than the original document
  160.       size. This not only reduces the scalability of the operation, but also
  161.       impacts overall performance by increasing the amount of memory garbage that
  162.       must be collected, tying up CPU cycles. Even if modern
  163.       virtual machines have reduced the overhead of garbage collection,
  164.       less garbage will always benefit performance and scalability.
  165.     </dd>
  166.   </dl>
  167.  
  168.   <p>The above points alone would be enough for the Cocoon
  169.   paradigm shift, even if this event based model impacts not only the general
  170.   architecture of the publishing system but also its internal processing
  171.   components such as XSLT processing and PDF formatting. These components will
  172.   require substantial work and maybe design reconsideration to be able to follow
  173.   a pure event-based model. The Cocoon Project will work closely with the other
  174.   component projects to be able to influence their operation in this direction.</p>
  175. </s1>
  176.  
  177. <s1 title="Reactors Reconsidered">
  178.   <p>Another design choice that should be revised is the reactor
  179.   pattern that was introduced to allow components to be connected in more
  180.   flexible way. In fact, by contrast to the fixed pipe model used up to Cocoon
  181.   1.3.1, the reactor approach allows components to be dynamically connected,
  182.   depending on reaction instructions introduced inside the documents.</p>
  183.  
  184.   <p>While this at first seemed a very advanced and highly
  185.   appealing model, it turned out to be a very dangerous approach. The first
  186.   concern is mainly technical: porting the reactor pattern under an event-based
  187.   model requires limitations and tradeoffs since the generated events must be
  188.   cached until a reaction instruction is encountered.</p>
  189.  
  190.   <p>But even if the technical difficulties could be solved, a key limitation
  191.   remains: there is no single point of management.</p>
  192. </s1>
  193.  
  194. <s1 title="Management Considerations">
  195.   <p>The web was created to reduce information management costs by
  196.   distributing them back on information owners. While this model is great for
  197.   user communities (scientists, students, employees, or people in general) each
  198.   of them managing small amount of personal information, it becomes impractical
  199.   for highly centralized information systems where <em>distributed management</em>
  200.   is simply not practical.</p>
  201.  
  202.   <p>While in the HTML web model the page format and URL names
  203.   were the only necessary contracts between individuals to create a world wide
  204.   web, in more structured information systems the number of contracts increases
  205.   by a significant factor due to the need of coherence between the
  206.   hosted information: common style, common design issues, common languages,
  207.   server side logic integration, data validation, etc...</p>
  208.  
  209.   <p>It is only under this light that XML and its web model reveal
  210.   their power: the HTML web model had too little in the way of contracts to be
  211.   able to develop a structured and more coherent distributed information system,
  212.   a reason that is mainly imposed by the lack of good and algorithmically certain
  213.   information indexing and knowledge seeking systems. Lacks that tend to degrade
  214.   the quality of the truly distributed web in favor of more structured web sites
  215.   (that based their improved site structure on internal contracts).</p>
  216.  
  217.   <p>The simplification and engineering of web site management is
  218.   considered one of the most important Cocoon goals. This is done mainly by
  219.   technologically imposing a reduced number of contracts and placing them in a
  220.   hierarchical shape, suitable for replacing current high-structure web site
  221.   management models.</p>
  222.  
  223.   <p>The model that Cocoon adopts is the "pyramid model of
  224.   web contracts" which is outlined in the picture below</p>
  225.  
  226.   <figure src="images/pyramid-model.gif"
  227.           alt="The Cocoon Pyramid Model of Contracts"
  228.           width="313" height="159"/>
  229.  
  230.   <p>and is composed by four different working contexts (the rectangles)</p>
  231.  
  232.   <dl>
  233.     <dt>Management</dt>
  234.     <dd>
  235.       The people that decide what the site should
  236.       contain, how it should behave and how it should appear
  237.     </dd>
  238.     <dt>Content</dt>
  239.     <dd>
  240.       The people responsible for writing, owning and managing
  241.       the site content. This context may contain several sub-contexts -
  242.       one for each language used to express page content.
  243.     </dd>
  244.     <dt>Logic</dt>
  245.     <dd>
  246.       The people responsible for integration with dynamic
  247.       content generation technologies and database systems.
  248.     </dd>
  249.     <dt>Style</dt>
  250.     <dd>
  251.       The people responsible for information
  252.       presentation, look & feel, site graphics and its maintenance.
  253.     </dd>
  254.   </dl>
  255.  
  256.   <p>and five contracts (the lines)</p>
  257.  
  258.   <ul>
  259.     <li>management - content</li>
  260.     <li>management - logic</li>
  261.     <li>management - style</li>
  262.     <li>content - logic</li>
  263.     <li>content - style</li>
  264.   </ul>
  265.  
  266.   <p>Note that there is no <em>logic - style</em> contract. Cocoon aims to
  267.   provide both software and guidelines to allow you to remove such a
  268.   contract.</p>
  269. </s1>
  270.  
  271. <s1 title="Overlapping contexts and Chain Mapping">
  272.   <p>The above model can be applied only if the different contexts
  273.   never overlap, otherwise there is no chance of having a single management
  274.   point. For example, if the W3C-recommended method to link stylesheets to XML
  275.   documents is used, the content and style contexts overlap and it's impossible
  276.   to change the styling behavior of the document without changing it. The same
  277.   is true for the processing instructions used by the Cocoon 1 reactor to drive
  278.   the page processing: each stage specifies the next stage to determine the result,
  279.   thus increasing management and debugging complexity. Another overlapping in
  280.   context contracts is the need for URL-encoded parameters to drive the page output.
  281.   These overlaps break the pyramid model and increase the management costs.</p>
  282.  
  283.   <p>Starting with Version 2.0, the reactor pattern has been abandoned in favor of
  284.   a pipeline mapping technique. This is based on the fact that the number of
  285.   different contracts is limited even for big sites and grows with a rate
  286.   that is normally much less than its size.</p>
  287.  
  288.   <p>Also, for performance reasons, Cocoon tries to compile
  289.   everything that is possibly compilable (pages/XSP into generators, stylesheets
  290.   into transformers, etc...) so, in this new model, the <em>processing chain</em>
  291.   that generates the page contains (in a direct executable form) all the
  292.   information/logic that handles the requested resource to generate its
  293.   response.</p>
  294.  
  295.   <p>This means that instead of using event-driven request-time DTD interpretation
  296.   (done in all Cocoon 1 processors), these are compiled into transformers
  297.   directly (XSLT stylesheet compilation) or compiled into generators using
  298.   logicsheets and XSP which will remove totally the need for request-time
  299.   interpretation solutions like DCP that has been removed.</p>
  300.  
  301.   <note>Some of these features were already present in latest Cocoon 1.x
  302.    releases but now the Cocoon architecture makes them central to its new
  303.    core.</note>
  304. </s1>
  305.  
  306. <s1 title="Sitemap">
  307.   <p>In Cocoon terminology, a <em>sitemap</em> is the collection of pipeline
  308.   matching informations that allow the Cocoon engine to associate the requested
  309.   URI to the proper response-producing pipeline.</p>
  310.  
  311.   <p>The sitemap physically represents the central repository for web site
  312.   administration, where the URI space and its handling is maintained.</p>
  313.  
  314.   <p>Please, take a look at the <link href="userdocs/concepts/sitemap.html">sitemap documentation</link>
  315.      for more information on this.</p>
  316.  
  317. </s1>
  318. <s1 title="Caching">
  319.  <p>The cache system of Cocoon has a very flexible and powerful design.
  320.    The algorithms and components used are not hard-wired to the core
  321.    of Cocoon. Instead they are dynamically configurable.</p>
  322.  <p>The cache system automatically checks for valid cached content and
  323.    delivers the valid content directly from the cache without any
  324.    pipeline processing.</p>
  325.   <p>The issue regarding static file caching that, no matter what, will 
  326.    always be slower than direct web server caching, means that Cocoon tries
  327.    to be as <em>proxy friendly</em> as possible.</p>
  328.   <p>To be able to put most of the static part of the job back on the web
  329.   server (where it belongs), Cocoon provides a command line
  330.   operation, allowing the creation of <em>site makefiles</em> that will
  331.   automatically scan the web site and the source documents and will provide a
  332.   way to <em>regenerate</em> the static part of a web site (images and tables
  333.   included!) based on the same XML model used in the dynamic operation version.</p>
  334.  
  335. <!-- Needs rewriting
  336.   <p>Cocoon will, in fact, be the integration between Cocoon 1 and Stylebook.</p>
  337.  
  338.   <p>It will be up to the web server administrator to use static
  339.   regeneration capabilities on a time basis, manually or triggered by some
  340.   particular event (e.g. database update signal) since Cocoon will only provide
  341.   servlet and command line capabilities. The nice integration is based on the
  342.   fact that there will be no behavioral difference if the files are dynamically
  343.   generated in Cocoon via the servlet operation and cached internally or
  344.   pre-generated and served directly by the web server, as long as URI contracts
  345.   are kept the same by the system administrator (via URL-rewriting or aliasing)</p>
  346.  
  347.   <p>Also, it will be possible to avoid on-the-fly page and stylesheet
  348.   compilation (which makes debugging harder) with command line pre-compilation
  349.   hooks that will work like normal compilers from a developer's point of view.</p>
  350. -->
  351. </s1>
  352.  </body>
  353. </document>
  354.