Turansky, Mark wrote:
how to reuse beans?
You should be making your beans without any thought of the web whatsoever. THEN your Actions can calls your beans. This way, the Actions are clients of your API. By having an API containing business logic (instead of business logic in your actions), you promote reuse.
An additional benefit of this type of bean design is that you can test it automatedly (JUnit!) without having Tomcat or servlet container running.
The Action, in this case, is the glue connecting all your business logic (beans). Replace the glue with another type of glue and you can reuse your business components anywhere.
+1 "You should be making your beans without any thought of the web whatsoever" "An additional benefit of this type of bean design is that you can test it" +1
And to underline the obvios.... Struts is MVC implementation. The benefit of MVC is MVC layers.
Then you can call your application (Yes, you can write console applications in Java, and re-use your Mail beans ) like this in bsh:
while true
do
$JAVA_HOME/bin/java -classpath $CLASSPATH com.async.run
sleep 100
done
Else... you did not do MVC Struts... oops.
hth, .V
-----Original Message----- From: Voinea, Marina [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 9:19 AM To: 'Struts Users Mailing List' Subject: RE: designing simple scheduler
Vic, can you please explain a bit more how do you reuse your beans ? (and have cron job call yor application - you know the idea of separating layers, how is your architecture like now ?)
(we would need something similar...) Thanks, M.
-----Original Message----- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 6:29 AM To: [EMAIL PROTECTED] Subject: Re: designing simple scheduler
With a layered MVC application you can re-use beans outside of Struts. Have cron call beans application. I do. .V
Raman wrote:
Hello,
I am using struts/beans in my application. I want a scheduler kind of
thing that after regular interval of time should check the db and send mails.
I want some suggestions regarding running it on red hat linux and way to
go for this.
Cheers, Raman Garg
--------------------------------------------------------------------- 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]

