I'm sorry Rahul but I don't understand your response (sure is for my bad English). Can you explain: " If it must be so (for whatever reason that I am no longer trying to identify :-), then it must not claim to be any variant of the basic impl anyway."
Thanks Mario -----Original Message----- From: Rahul Akolkar [mailto:[EMAIL PROTECTED] Sent: 24 luglio 2007 21.12 To: user@shale.apache.org Subject: Re: Customizing Basic DialogContextManager On 7/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > The reason is that I have, in special cases, to change the name of the > dialog name to start and I can't change the code of my web application. <snip/> I'd say make sure you have the right name before you hit the basic dialog manager impl (but you already seem to indicate thats not possible). > For example: > public ... create(javax.faces.context.FacesContext context, > String name) > { > if(usaPresident.equalsIgnoreCase("BUSH")) name = "NoWarsPlease"; > > super.create(context,name); > } > > (I don't understand the antipattern..... > and I don't understand why > org.apache.shale.dialog.basic.BasicDialogManager is final) > <snap/> Its along these lines: * Shale has one dialog API and many potential dialog implementations * Each implementation defines certain contracts (these must adhere to the contracts in the API, and may additionally define impl-specific contracts and features as well) * If subclassing is allowed, it may be possible that the subclass (knowingly or unknowingly) ceases to honor some of the contracts for that impl * As an aside, the mechanics of getting subclassing to work as expected are cumbersome (since that wasn't a design consideration) Lets look at your example above: The dialog manager contract indicates that the create() method will instantiate a dialog context for the given dialog name. By returning a dialog context for another dialog name, that contract is no longer fulfilled. If it must be so (for whatever reason that I am no longer trying to identify :-), then it must not claim to be any variant of the basic impl anyway. -Rahul > Thanks > Mario > -----Original Message----- > From: Rahul Akolkar [mailto:[EMAIL PROTECTED] > Sent: 23 luglio 2007 21.19 > To: user@shale.apache.org > Subject: Re: Customizing Basic DialogContextManager > > On 7/20/07, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > Hi Rahul, > > What I need is to extend the "create" method of > > org.apache.shale.dialog.basic.BasicDialogManager > > > > for example doing: > > > > public ... create(javax.faces.context.FacesContext context, > > String name) > > { > > Super.create(context,name); > > System.out.println("Hello Rahul"); > > } > > > <snip/> > > I'm saying this is more an anti-pattern (i.e. avoid, if possible :-) > > Can you use the DialogContextManagerListener [1] for this purpose? If > not, I'll go back to my questions two replies ago -- what is the > reason? Is the reason related to SHALE-454 [2] ? > > -Rahul > > [1] > http://shale.apache.org/shale-dialog/apidocs/org/apache/shale/dialog/Dia > logContextManagerListener.html > > [2] http://issues.apache.org/struts/browse/SHALE-454 > > > > > > > Thanks > > Mario > > This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.