Return-Path: Delivered-To: apmail-cocoon-docs-archive@www.apache.org Received: (qmail 83739 invoked from network); 14 Sep 2005 13:34:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Sep 2005 13:34:50 -0000 Received: (qmail 10999 invoked by uid 500); 14 Sep 2005 13:34:50 -0000 Delivered-To: apmail-cocoon-docs-archive@cocoon.apache.org Received: (qmail 10961 invoked by uid 500); 14 Sep 2005 13:34:49 -0000 Mailing-List: contact docs-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: docs@cocoon.apache.org List-Id: Delivered-To: mailing list docs@cocoon.apache.org Received: (qmail 10948 invoked by uid 99); 14 Sep 2005 13:34:49 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Sep 2005 06:34:48 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 7F585136 for ; Wed, 14 Sep 2005 15:34:47 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: docs@cocoon.apache.org Date: Wed, 14 Sep 2005 13:34:47 -0000 Message-ID: <20050914133447.16902.27770@ajax.apache.org> Subject: [Cocoon Wiki] Update of "ServiceAccessPattern" by JCKermagoret X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification. The following page has been changed by JCKermagoret: http://wiki.apache.org/cocoon/ServiceAccessPattern New page: = Intent = This pattern's goal is to have a very loose coupling between cocoon services and the data provided by the generator. = Motivation = When developing web applications, we usually quickly prototype a solution for one context. Often, requirements evolve and multi context support is needed. This pattern provides a systematic approach to make services multi context aware, with an elaborated fallback mechanism to manage specific, then common, then default (for example) configuration. Moreover, all the information where mapping from name services to services' paths are centralized in one location only. Things are easy to update and maintain. = Architecture = attachment:loose-coupling-dataaccess-dp.gif = Implementation = == Tight coupling == It is a very simple pipeline. attachment:tight-coupling-dataaccess-dp.gif {{{ }}} This web app works well, but if your boss suddenly tells you : "Well, things are changing quite a bit. The customer wants one web app to serve multiple hosts. And the 'hello' may change according the user's role." Of course, there are a lot of services beside the hello one with the same kind of requirement. You have to update every service. So, after a quick brainstorming, you suggest to create a context directory under docs one. And you immediately go back to work and do it : {{{ }}} At this point, you think it may be a good idea to centralize data for each context in one location only. You immediately go back to work and create the following : {{{ }}} But you have to update every service again. After a few cycles like this one, you're a little fed up with all this mess, and the always evolving requirements. So, you decide to be agile and build a medium coupling solution : == Medium coupling solution == attachment:medium-coupling-dataaccess-dp.gif {{{ }}} In this solution, you only to update the getData-* pipeline to reflect new requirements. But you have to do that for all your applications (all your sitemaps). == Loose coupling solution == attachment:loose-coupling-dataaccess-dp.gif {{{ }}} And you have in the locator directory at the root of your cocoon app the following : {{{ }}} You can improve the fallback mechanism by adding new situations for anonymous user for example : {{{ }}} Now, to solve new requirements, you just need to update the locator sitemap. If your boss tells you the customer wants the information in a database. Don't worry, just update your locator sitemap (but you will need in this case to update the resource-exists action too). JCKermagoret