On Fri, 2005-08-19 at 10:08 +0200, Andreas Hartmann wrote:
> Thorsten Scherler wrote:
> 
> > +   /**
> > +    * @return Returns the useCforms.
> > +    */
> > +   public boolean isUseCforms() {
> > +           return useCforms;
> > +   }
> 
> I'd rather make this more general:
> 
> 
>    <usecase ...>
>      <view type="cforms">
>        <cforms definition="..." binding="..."/>
>        ...
>      </view>
>    </usecase>
> 
> 
> 
>    public static String VIEW_JX = "jx";
>    public static String VIEW_CFORMS = "cforms";
>    public static String VIEW_FOO = "foo";
> 
>    public int getViewType() {
>        return this.viewType
>    }
> 
> 
> Maybe we can use a ViewHandler class or something else
> to use polymorphism instead of static fields and an if/then/else
> condition in usecases.js?
> 
> JavaScript is interpreted, so we can even create function
> calls dynamically.
> 
> 
>    function cformsView(...) { ... }
>    function jxView(...) { ... }
>    function fooView(...) { ... }
> 
>    ...
> 
>    eval(usecase.getViewType + "View(...)");
> 
> 
> That is IMO cleaner than if/then/else.

Can you extend a wee bit on that?

I reckon that is the only suitable way.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to