Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 16853 invoked by uid 500); 19 May 2003 10:12:42 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 16836 invoked from network); 19 May 2003 10:12:41 -0000 Received: from mail.s-und-n.de (212.8.217.2) by daedalus.apache.org with SMTP; 19 May 2003 10:12:41 -0000 Received: from mail.s-und-n.de (localhost [127.0.0.1]) by mail2.s-und-n.de (postfix) with ESMTP id 2225EAC3D2 for ; Mon, 19 May 2003 12:12:55 +0200 (CEST) Received: from notes.sundn.de (ntsrv5.sundn.de [10.10.2.10]) by mail.s-und-n.de (postfix) with ESMTP id 0A8ACA2E5D for ; Mon, 19 May 2003 12:12:55 +0200 (CEST) Received: from hw0386 ([10.10.2.34]) by notes.sundn.de (Lotus Domino Release 5.0.8) with SMTP id 2003051912125405:115133 ; Mon, 19 May 2003 12:12:54 +0200 From: "Carsten Ziegeler" To: "Cocoon-Dev" Subject: [RT] Access to the object model Date: Mon, 19 May 2003 12:14:16 +0200 Message-ID: MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 19.05.2003 12:12:54, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 19.05.2003 12:12:54, Serialize complete at 19.05.2003 12:12:54 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Simple RT today :) What do you think about making the object model accessible from non-sitemap components? Currently, when implementing such a component, you don't have directly access to the object model that contains some important information (request, perhaps fom etc). No, one solution is to add the object model to the interface of your component. This is not the best solution as then this component is only usable by a sitemap component. Or you can use the RequestLifecycleComponent marker interface and get via a setup() method the object model set. But this prevents you from making the component thread safe. Now, I could imagine three possible solutions: a) create a static (!) method at ObjectModelHelper that provides the object model for the current request. Please note, that we already have a static method somewhere in cocoon that uses thread local variables and can easily be used. So nothing new has to be invented. b) Create a new marker interface for components and via this marker interface a component can get a "handler" for the object model. c) Use the Contextualizable interface and put a "handler" in the context object. Now, the most simple approach is a), but that'S not IoC. - I think the cleanest solution is b), but that would require a new marker interface. I currently tend to a), What do you think? Is is bad to get the object model in a custom component? Carsten