RE: Design Problem Action Class

2003-03-31 Thread Dario Geier
I am having the same problem shortly. I am thinking of the following solution:

First, you'll need to inherit from all the action type classes you'll need in your 
application.

Action  DispatchAction  SwitchAction
   YY  Y
MyActionMyDispatchActionMySwitchAction

From this custom layer, use delegation to call common to all actions functionality. 
Then, you write this functionality just once, and it is actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still wabnted to use 
the action classes from Scaffold package(FindForward action etc..)

But what I have done is I am using those action classes as they are,they do not belong 
to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not belong to 
your applications action hierarchy.And even if they do not extend from the 
AbstractAction of u r appliaction, u will not have any problem.BEcause they are necven 
called directly.They are used some where in the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]



Re: Design Problem Action Class

2003-03-31 Thread Navjot Singh
so this is the only solution
i was thinking if somehow i can 2 extend classes. ;-)
__C++ was good__

- Original Message -
From: Dario Geier [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 6:26 PM
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following
solution:

First, you'll need to inherit from all the action type classes you'll need
in your application.

Action DispatchAction SwitchAction
   Y YY
MyAction MyDispatchAction MySwitchAction

From this custom layer, use delegation to call common to all actions
functionality. Then, you write this functionality just once, and it is
actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still
wabnted to use the action classes from Scaffold package(FindForward action
etc..)

But what I have done is I am using those action classes as they are,they do
not belong to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not
belong to your applications action hierarchy.And even if they do not extend
from the AbstractAction of u r appliaction, u will not have any
problem.BEcause they are necven called directly.They are used some where in
the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]



RE: Design Problem Action Class

2003-03-31 Thread shirishchandra.sakhare
But I dont get the point of extending those Helper Actions...

Becasue those helper classes will never fulfill a request on thier own..So ultimately 
whtever is the application logic in your base action(Like login check etc..)will be 
executed as the call finally goes to some Other applicationAction...

And Also I am not sure what u mean by delegation here..But beware...If u mean caling 
one action which does all of this from all other actions, it is stringly discouraged 
in struts..Use of Actions as APIs is strongly discouraged..

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following solution:

First, you'll need to inherit from all the action type classes you'll need in your 
application.

Action  DispatchAction  SwitchAction
   YY  Y
MyActionMyDispatchActionMySwitchAction

From this custom layer, use delegation to call common to all actions functionality. 
Then, you write this functionality just once, and it is actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still wabnted to use 
the action classes from Scaffold package(FindForward action etc..)

But what I have done is I am using those action classes as they are,they do not belong 
to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not belong to 
your applications action hierarchy.And even if they do not extend from the 
AbstractAction of u r appliaction, u will not have any problem.BEcause they are necven 
called directly.They are used some where in the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]



RE: Design Problem Action Class

2003-03-31 Thread Dario Geier
Yes, delegation is the common alternative for multiple inheritance. If you are using 
IntelliJ, you can use the Code / Delegate Methods menu option. It will write the 
methods for you :)

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:59 PM
To: Struts Users Mailing List
Subject: Re: Design Problem Action Class


so this is the only solution
i was thinking if somehow i can 2 extend classes. ;-)
__C++ was good__

- Original Message -
From: Dario Geier [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 6:26 PM
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following
solution:

First, you'll need to inherit from all the action type classes you'll need
in your application.

Action DispatchAction SwitchAction
   Y YY
MyAction MyDispatchAction MySwitchAction

From this custom layer, use delegation to call common to all actions
functionality. Then, you write this functionality just once, and it is
actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still
wabnted to use the action classes from Scaffold package(FindForward action
etc..)

But what I have done is I am using those action classes as they are,they do
not belong to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not
belong to your applications action hierarchy.And even if they do not extend
from the AbstractAction of u r appliaction, u will not have any
problem.BEcause they are necven called directly.They are used some where in
the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]


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



RE: Design Problem Action Class

2003-03-31 Thread Dario Geier
What I meant by delegation is using a different ActionUtility class. The base 
executeAction / performAction method implementation could be implemented as a Template 
method, where you call your checkForLogin and other methods as you wish.
I am not calling other actions, but a neutral independent class.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:07 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


But I dont get the point of extending those Helper Actions...

Becasue those helper classes will never fulfill a request on thier own..So ultimately 
whtever is the application logic in your base action(Like login check etc..)will be 
executed as the call finally goes to some Other applicationAction...

And Also I am not sure what u mean by delegation here..But beware...If u mean caling 
one action which does all of this from all other actions, it is stringly discouraged 
in struts..Use of Actions as APIs is strongly discouraged..

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following solution:

First, you'll need to inherit from all the action type classes you'll need in your 
application.

Action  DispatchAction  SwitchAction
   YY  Y
MyActionMyDispatchActionMySwitchAction

From this custom layer, use delegation to call common to all actions functionality. 
Then, you write this functionality just once, and it is actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still wabnted to use 
the action classes from Scaffold package(FindForward action etc..)

But what I have done is I am using those action classes as they are,they do not belong 
to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not belong to 
your applications action hierarchy.And even if they do not extend from the 
AbstractAction of u r appliaction, u will not have any problem.BEcause they are necven 
called directly.They are used some where in the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]


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



Re: Design Problem Action Class

2003-03-31 Thread Navjot Singh
hi shirish,

SAY

We write 2 methods in Action (MUST extend DynamicAction here) Class

public ActionForward add(...)
public ActionForward del(...)

AND
we have action tag in config file saying
action type=.. parameter=param 

Calling URLs
a.do?param=add
a.do?param=del

will directly call those methods.

AND there by save  2 IFs in execute(...) method :-)

Hope now you would agree THIS  Helper Action class is really useful ;-)

regards
Navjot Singh

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 6:36 PM
Subject: RE: Design Problem Action Class


But I dont get the point of extending those Helper Actions...

Becasue those helper classes will never fulfill a request on thier own..So
ultimately whtever is the application logic in your base action(Like login
check etc..)will be executed as the call finally goes to some Other
applicationAction...

And Also I am not sure what u mean by delegation here..But beware...If u
mean caling one action which does all of this from all other actions, it is
stringly discouraged in struts..Use of Actions as APIs is strongly
discouraged..

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following
solution:

First, you'll need to inherit from all the action type classes you'll need
in your application.

Action DispatchAction SwitchAction
   Y YY
MyAction MyDispatchAction MySwitchAction

From this custom layer, use delegation to call common to all actions
functionality. Then, you write this functionality just once, and it is
actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still
wabnted to use the action classes from Scaffold package(FindForward action
etc..)

But what I have done is I am using those action classes as they are,they do
not belong to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not
belong to your applications action hierarchy.And even if they do not extend
from the AbstractAction of u r appliaction, u will not have any
problem.BEcause they are necven called directly.They are used some where in
the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]




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



RE: Design Problem Action Class

2003-03-31 Thread shirishchandra.sakhare
Hi Navjot,
I never said that these helper classes are not required..Infact I am using them 
heavily in my application..

What i am saying is U need not extend those acions or copy thier code in your base 
actionBEcause that does not serve any purpose..


U can use the dispatch action as it is...

regards,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:23 PM
To: Struts Users Mailing List
Subject: Re: Design Problem Action Class


hi shirish,

SAY

We write 2 methods in Action (MUST extend DynamicAction here) Class

public ActionForward add(...)
public ActionForward del(...)

AND
we have action tag in config file saying
action type=.. parameter=param 

Calling URLs
a.do?param=add
a.do?param=del

will directly call those methods.

AND there by save  2 IFs in execute(...) method :-)

Hope now you would agree THIS  Helper Action class is really useful ;-)

regards
Navjot Singh

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 31, 2003 6:36 PM
Subject: RE: Design Problem Action Class


But I dont get the point of extending those Helper Actions...

Becasue those helper classes will never fulfill a request on thier own..So
ultimately whtever is the application logic in your base action(Like login
check etc..)will be executed as the call finally goes to some Other
applicationAction...

And Also I am not sure what u mean by delegation here..But beware...If u
mean caling one action which does all of this from all other actions, it is
stringly discouraged in struts..Use of Actions as APIs is strongly
discouraged..

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following
solution:

First, you'll need to inherit from all the action type classes you'll need
in your application.

Action DispatchAction SwitchAction
   Y YY
MyAction MyDispatchAction MySwitchAction

From this custom layer, use delegation to call common to all actions
functionality. Then, you write this functionality just once, and it is
actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still
wabnted to use the action classes from Scaffold package(FindForward action
etc..)

But what I have done is I am using those action classes as they are,they do
not belong to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not
belong to your applications action hierarchy.And even if they do not extend
from the AbstractAction of u r appliaction, u will not have any
problem.BEcause they are necven called directly.They are used some where in
the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]




-
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]



RE: Design Problem Action Class

2003-03-31 Thread Dario Geier
Well, that depends on your implementation.
If need to perform any checkings (like checking whether the user has logged in) before 
any or almost any action you perform, then you'll need this customed layer (i.e. 
you'll call the ActionUtility.checkLoggedUser() method before calling executeAction in 
every BaseAction class).
Even you can use them for customizing your logging.

This is not too much work, and it could be of great use in the future.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:39 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


this sounds good idea...But still I dont see any reason to extend those helpr 
classes..U can use them out of the box :-))

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:20 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


What I meant by delegation is using a different ActionUtility class. The base 
executeAction / performAction method implementation could be implemented as a Template 
method, where you call your checkForLogin and other methods as you wish.
I am not calling other actions, but a neutral independent class.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:07 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


But I dont get the point of extending those Helper Actions...

Becasue those helper classes will never fulfill a request on thier own..So ultimately 
whtever is the application logic in your base action(Like login check etc..)will be 
executed as the call finally goes to some Other applicationAction...

And Also I am not sure what u mean by delegation here..But beware...If u mean caling 
one action which does all of this from all other actions, it is stringly discouraged 
in struts..Use of Actions as APIs is strongly discouraged..

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following solution:

First, you'll need to inherit from all the action type classes you'll need in your 
application.

Action  DispatchAction  SwitchAction
   YY  Y
MyActionMyDispatchActionMySwitchAction

From this custom layer, use delegation to call common to all actions functionality. 
Then, you write this functionality just once, and it is actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still wabnted to use 
the action classes from Scaffold package(FindForward action etc..)

But what I have done is I am using those action classes as they are,they do not belong 
to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not belong to 
your applications action hierarchy.And even if they do not extend from the 
AbstractAction of u r appliaction, u will not have any problem.BEcause they are necven 
called directly.They are used some where in the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards
Navjot Singh



-
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]


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

RE: Design Problem Action Class

2003-03-31 Thread shirishchandra.sakhare
Thats the point..
Generally in your abs action class, u will have some preprocessing(Like login check)  
and may be some post processing..And thast why u want all u r actions to extend the 
base action class .Fair enough...

But if u are using Those helper classes(Like dispatch Action.)It will ultimately 
forward to one of your application action.And those checks u have mentioned (Do Login 
checks etc) will be run there.So my point is u dont need to have base classes which 
will extend all those helper classes as well.This will avoid too many base classes in 
your Action hierarchies and make the class tree simple and plain.

hope this clears my point :-))



-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:24 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


Well, that depends on your implementation.
If need to perform any checkings (like checking whether the user has logged in) before 
any or almost any action you perform, then you'll need this customed layer (i.e. 
you'll call the ActionUtility.checkLoggedUser() method before calling executeAction in 
every BaseAction class).
Even you can use them for customizing your logging.

This is not too much work, and it could be of great use in the future.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:39 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


this sounds good idea...But still I dont see any reason to extend those helpr 
classes..U can use them out of the box :-))

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:20 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


What I meant by delegation is using a different ActionUtility class. The base 
executeAction / performAction method implementation could be implemented as a Template 
method, where you call your checkForLogin and other methods as you wish.
I am not calling other actions, but a neutral independent class.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 4:07 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


But I dont get the point of extending those Helper Actions...

Becasue those helper classes will never fulfill a request on thier own..So ultimately 
whtever is the application logic in your base action(Like login check etc..)will be 
executed as the call finally goes to some Other applicationAction...

And Also I am not sure what u mean by delegation here..But beware...If u mean caling 
one action which does all of this from all other actions, it is stringly discouraged 
in struts..Use of Actions as APIs is strongly discouraged..

-Original Message-
From: Dario Geier [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:56 PM
To: Struts Users Mailing List
Subject: RE: Design Problem Action Class


I am having the same problem shortly. I am thinking of the following solution:

First, you'll need to inherit from all the action type classes you'll need in your 
application.

Action  DispatchAction  SwitchAction
   YY  Y
MyActionMyDispatchActionMySwitchAction

From this custom layer, use delegation to call common to all actions functionality. 
Then, you write this functionality just once, and it is actiontype independent.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: RE: Design Problem Action Class


I had faced simalr problem..

We have our own AbstractAction and other action hierarchy..And i still wabnted to use 
the action classes from Scaffold package(FindForward action etc..)

But what I have done is I am using those action classes as they are,they do not belong 
to my applications action hierarchy..And that makes sense..

BEcause most of those action classes are utility classes .So they do not belong to 
your applications action hierarchy.And even if they do not extend from the 
AbstractAction of u r appliaction, u will not have any problem.BEcause they are necven 
called directly.They are used some where in the application flow as utility classes.

hope this helps,
Shirish

-Original Message-
From: Navjot Singh [mailto:[EMAIL PROTECTED]
Sent: Monday, March 31, 2003 2:28 PM
To: Struts Users List
Subject: Design Problem Action Class


Hi geeks,

I have class hierarchy like this.

CustomerAction
Y
   AppAction
Y
 Action

Now that i have seen DisapatchAction, I wish to use it for my further
actionclasses.
BUT the problem is DispatchAction extends Action.

One way i can think of is to change AppAction to start extending
DisptachAction.
BUT all of my classes don't need the functionality of DisptachAction.
Just a few need this functionality.

How can I go about it?

regards