I probably wasn't clear enough...
Let's say I have screens A, B and C and I want them to implement behavior
alpha.
I also have screens D, E and F and I want them to implement behavior beta.
Now, I could create two abstract java screen classes called alpha and beta.
Then I create java classes A - F and I let them extend alpha and beta. This
will work, however I will have 6 classes (A-F) that do not have a body. They
will all look like this:
public class A extends Alpha {
}
public abstract class Alpha extends VelocityScreen {
//Here there will actually be code
}
My question is:
Is this the only way to execute the code in Alpha when a request for A.vm is
made?
The only issue here is that I might end up with 20 or something classes that
look like the A class, and I wonder if that is really necessary.
/Ludwig
-----Original Message-----
From: Juergen Hoffmann [mailto:[email protected]]
Sent: den 27 januari 2009 15:15
To: 'Turbine Users List'
Subject: AW: Question about extending the screen object
Hi Ludwig,
extend from your Default Screen and overwrite the methods you would like to
change...
Did I get you wrong?
Kind regards
Juergen
> -----Ursprüngliche Nachricht-----
> Von: Ludwig Magnusson [mailto:[email protected]]
> Gesendet: Dienstag, 27. Januar 2009 14:20
> An: 'Turbine Users List'
> Betreff: RE: Question about extending the screen object
>
> Allright I think that will solve my problems for now, however what if I
> want
> two sets of screens that have different behavior? Is there a solution
> for
> that?
> /Ludwig
>
> -----Original Message-----
> From: Juergen Hoffmann [mailto:[email protected]]
> Sent: den 27 januari 2009 11:53
> To: 'Turbine Users List'
> Subject: AW: Question about extending the screen object
>
> Hi Ludwig,
>
> create a Default.class Turbine will look for it if it cannot find a
> screen
> Class for a specific Template.
>
> It looks for <Package1>.<subpackage>.<TemplateName>.class
> Then for <Package1>.<subpackage>.Default.class
> Then for <Package1>.Default.class
>
> And so on.
>
> I hope this made it clear
>
> Kind regards
>
> Juergen
>
> > -----Ursprüngliche Nachricht-----
> > Von: Ludwig Magnusson [mailto:[email protected]]
> > Gesendet: Dienstag, 27. Januar 2009 10:51
> > An: 'Turbine Users List'
> > Betreff: Question about extending the screen object
> >
> > Hi!
> >
> > On my site I have several screens that I want a certain specific
> java-
> > coded
> > behavior for. I see in the documentation that the way to do this is
> to
> > create a Super-Screen class and let all my other screens extend that
> > one.
> > However, if I don't want to implement any other behavior in the
> screens
> > this
> > means that I will have several java classes with an empty body, all
> > they do
> > is extend my Super-Screen.
> >
> > Is this the way to do it or is there any way around this so I do not
> > need to
> > create one class for each template?
> >
> >
> >
> > Or rather, can FooTemplate.vm execute the code in BarClass.class?
> >
> > /Ludwig
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]