Re: simple java question with WOComponent sub-classes
Re: simple java question with WOComponent sub-classes
- Subject: Re: simple java question with WOComponent sub-classes
- From: David Aspinall <email@hidden>
- Date: Thu, 6 Jul 2006 22:51:32 -0400
Make an interface called SecureConponentInterface (or whatever) and then
public class SecureComponent extends WOComponent implements
SecureConponentInterface
{
public class ReviewTrans extends WOLongResponsePage implements
SecureConponentInterface
{
The sucks part is having to duplicate the implementation (assuming
there is implementation in SecureComponent). You could handle this
by using a utility class with static methods to perform those
methods, just remember to pass the context and the request.
Just a thought.
David
On 6-Jul-06, at 3:50 PM, Chuck Hill wrote:
On Jul 6, 2006, at 11:18 AM, Baiss Eric Magnusson wrote:
I have a class
public class SecureComponent extends WOComponent {
I have
public class ReviewTrans extends SecureComponent {
I want it to be
public class ReviewTrans extends SecureComponent {
where <SecureComponent> is a sub-class of WOLongResponsePage, not
WOComponent, but only for this one class.
NOTE: WOLongResponsePage is a sub-class of WOComponent.
All I can see to do is duplicate the code in SecureComponent and
create another class <SecureComponentLong>.
That is the expedient way as Java does not support multiple
inheritance. The only other option that I can think of is AOP
(http://www.stepwise.com/Articles/AspectJ/). But that is overkill
for the small amount of duplication you are talking about.
Chuck
--
Coming sometime... - an introduction to web applications using
WebObjects and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/
practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40ticoon.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden