Return-Path: Delivered-To: apmail-jakarta-taglibs-dev-archive@www.apache.org Received: (qmail 66260 invoked from network); 22 Jul 2005 15:36:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jul 2005 15:36:10 -0000 Received: (qmail 59827 invoked by uid 500); 22 Jul 2005 15:36:08 -0000 Delivered-To: apmail-jakarta-taglibs-dev-archive@jakarta.apache.org Received: (qmail 59799 invoked by uid 500); 22 Jul 2005 15:36:08 -0000 Mailing-List: contact taglibs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tag Libraries Developers List" Reply-To: "Tag Libraries Developers List" Delivered-To: mailing list taglibs-dev@jakarta.apache.org Received: (qmail 59778 invoked by uid 99); 22 Jul 2005 15:36:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2005 08:36:07 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=HTML_20_30,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [207.172.4.63] (HELO smtp04.mrf.mail.rcn.net) (207.172.4.63) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2005 08:36:02 -0700 Received: from 24-148-46-165.alc-bsr1.chi-alc.il.cable.rcn.com (HELO [192.168.1.129]) ([24.148.46.165]) by smtp04.mrf.mail.rcn.net with ESMTP; 22 Jul 2005 11:36:02 -0400 X-IronPort-AV: i="3.95,135,1120449600"; d="scan'208,217"; a="61691466:sNHT121838652" Mime-Version: 1.0 (Apple Message framework v733) In-Reply-To: References: Content-Type: multipart/alternative; boundary=Apple-Mail-1--142042944 Message-Id: <7707D60F-9946-4EF4-A910-01804D8D219C@nvisia.com> From: Stu Robertson Subject: Re: Concerns expressed by Stu Robertson Date: Fri, 22 Jul 2005 10:36:01 -0500 To: Tag Libraries Developers List X-Mailer: Apple Mail (2.733) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Apple-Mail-1--142042944 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Thanks Rahul :-) You are right about i18n of the config attribute. The fact that it's cached doesn't matter since in the case of i18n, the config set as an application-space variable would never have more than 1 value in a user's session. The layers principle holds: the taglib doesn't prevent this from happening (my concern). So, as I hoped, I can apologize on that one (though it's nice that you and your colleagues think I don't have to :-). Regarding application needs for config to be a variable that _would_ change during a user's session, here I think we need to be creative. I hadn't looked at the impacts of stateMap caching via id + config on DialogManager and grouping, so if it isn't as straightforward as I was thinking... well, thanks for saving me time. One thing that's probably safe to assume about almost all application requirements that require the prompts to shift within a session (in our case, the user has to switch to DTMF only; input-mode is set to disable voice grammars reducing impact of noise, and prompts shift to give DTMF- only instructions) is that this won't happen very often within a session. At most, once. I'm wondering if we could support this by flushing the stateMap cache when this does happen. We'd loose any cached configs at that point, and from that point on the new value of application-specified configs would be used. The performance cost would be zero since the originally cached values wouldn't be used anyway, and we need to re-initialize the models from the new configs regardless. Is flushing the stateMap cache simply a matter of stateMap.clear()? If this or some variation works, then we can meet our requirements this way. Let's talk about the other issues I brought up when you and your team have time after the first release. Now that I see that the RDC project does meet i18n requirements, my hesitations about a 1.0 release are gone. But I do think that the RDCs would benefit substantially from a bit of refactoring work. Not because of quality; I haven't found many bugs at all. My primary issue with the existing implementation is that the widespread use of tag files hampers reuse, complicates unit testing and leads to other limitations I brought up in my earlier email. I'm curious what others think about this. My thought is that refactoring could be done internally to the library. The public interface (the TLDs) could be kept intact. Meanwhile we could push core functionality such as the FSM, configuration, and other support functionality down into java. We could implement regression tests for these components, and then rebuild the core tags as normal TagHandlers. Given that the RDCs themselves are almost identical internally, something like a RdcTagSupport class would do all of the work, making for a set of trivial core tags. And we could very easily implement regression testing of each of these, either using mocks or (my new favorite) canoo. The benefits of this in my view include: * Improving testability of the framework. Internals could be tested using unit testing. * Simplifying extension of the RDCs through creating a JSTL-like set of support classes for tag authors. Eliminate cut-and-paste entirely. Core functionality can be designed using appropriate patterns for flexibility. The FSM could become a Strategy for instance, allowing new functionality to be added by changing the FSM only (maybe not the best example - but you get the idea) * All the benefits that come from having core logic in java instead of JSP tags: can leverage the compiler for type safety, IDE-assisted refactoring, more concise and readable implementation, ability to use tools in java space as they appear (AspectJ is a contrived but possible example. XDoclet for maintaining TLDs is a better one - would like to hear others' thoughts on that one too). I'll have some bandwidth to work on the RDC project over the coming months. Let's talk about design when you have time. I'm curious to know what the core team has in mind for the library, and what it thinks about how we can make it even better. Stu On Jul 21, 2005, at 4:26 PM, Rahul P Akolkar wrote: > > Stu - > > I wouldn't worry about an emotional response, its a lack of emotion > that sometimes gets me worried. I will probably discontinue cc'ing > others from the next email, if this thread continues. Ofcourse, as > Raman mentioned, we should go back on taglibs-dev (whenever you want). > > Let me begin by addressing the key questions you ask with regards > to my last email on the taglibs-dev list, which is what you > suggested we do. I suspect you are misreading the code in a couple > of places, though you can tell me if I'm wrong. My explanation > below might appear "too basic", thats only because my last two > attempts have failed miserably. > > > We do a lookup in the default (and non-overideable if you look at > the baseModel) resourceBundle - there is no setResourceBundle and > it's set from a constant. > > > But there is a setLocale, which updates the resource bundle (since > the locale dictates which resouce bundle is used to pull out > resources). > > > What does the locale have to do with anything other than for the > defaultConfig? > > > It has to do with xml:lang attributes and grammar URIs (you > probably want the language in the grammar to match the prompts, > though at times, it might not matter). > > Try this example from the distro (rdc-examples.war): > usState-test.jsp > > Then try this: > i18n-test.jsp > > Compare the VoiceXML markup on either invocation (you can just use > a web browser). Notice that the xml:lang attributes have changed. > Try adding a en-GB properties file for good measure, notice those > URIs being picked up for the grammars and the config. > > Let us separate the two remaining issues here: internationalizing > app-specific config URIs, and having more than one config per > instance. Lets start by looking solely at the first. > > > To get internationalization then, one would think you'd have to > pass in the URI of an internationalization-appropriate config file. > But if you look at the implementation of the tags themselves, you'd > find that you're out of luck. > > If the "layers" approach that the RDC library supplies works, as > mentioned in your response to taglibs-dev, and the applications can > simply add this functionality, how is it that we can achieve this > without rewriting the ditigs.tag file -- and every other tag we > might want to use? > > > Akin to the examples from the distro above: [variable names > intentionally verbose] > > config="myEnglishUSDigitsAppSpecificConfig.xml" /> > > config="myFrenchCanadianDigitsAppSpecificConfig.xml" /> > > which gets generalized to: > > > > RDC layer - takes care of i18n'zing the grammar and xml:lang > attributes. > App layer - takes care of i18n'zing the prompt URI, which in this > case, is an app-specific resource, and the RDC layer just uses it > as an absolute URI, with no i18n treatment (as you noted). > > > I implemented this last week. It does not work. The RDCs cache > configs based on their id only, as shown in the example above > included in boilerplate from every RDC tag. > > > If we're still talking about the first issue, I don't see why not. > The caching is per session, so when the US English user calls he > gets a fresh instance of date foo and when the French canadian user > calls, he/she gets another. Notice the bean is created in page > scope and cached in session scope. > > > Given that this id is an absolute URI, where exactly is the support > for i18n? > > > In the app. In the spirit of rapid prototyping and iterating, I'm > happy to look at prototypes which push this i18n in the RDC. If we > are going to allow the app-specific config URI to be passed in as a > resource key, we will also need to pass in the fully qualified > bundle name and the locale, and at the same time we will still have > to support static URIs. > > > I'm sorry you consider i18n support for any RDCs using non-default > prompts/help/no-match/no-input to be something with no urgency. I > am also sorry you consider rewriting each and every RDC tag file > implementation to be fairly insignificant for the RDC target audience. > > > No urgency on my part just means I do not have the cycles to pursue > this right now (i.e. this week or next). More importantly, each tag > implementation does not need to be changed for i18n'zing > application specific config URIs, as I point out above. > > Now, coming to the second issue, which is switching configs while > an RDC is interacting with the user (a.k.a more than one config). > The way suggested we address (on the taglibs-dev list) was by > suggesting a two-step refactoring approach: > Step 1) Remove the redundancy in each tag impl with respect to the > bits that initialize, cache and retrieve the data model (by using a > helper tag) -- this will help us here, and maybe in more places in > the future. > Step 2) Make changes to how caching and retrieving is done in one > place. > > I can take a stab at (1), when I have an opportunity. > > > If we change this to store/cache the model using 'id + config' then > we have the ability to vary the config according to locale or other > application-specific reasons. > > > This has implications to aggregation (group) and composition (RDC > composites) as well. Have you thought about these implications? I > do not understand this approach, because I think of this as one > model, many configs not many model-config pairs. But ofcourse, I'm > open to looking at any working prototypes. > > Finally, as I (and then Raman) pointed out, depending on how fast > we make progress, the next RDC release might be sooner than you > think. True, we could have waited for perfection before making any > release, but someone once told me that has a NP-hard solution. > > -Rahul --Apple-Mail-1--142042944--