Programming technique for application running even if the user exits UI

Hello to everyone,

Since new to Java i have some basic questions on programming techniques that i would like to ask.

My question is what technique can be used in a Java application that needs to run even if the user exits the UI. For example, an application that the user feeds with email addresses and the message body, then ask the application to start sending and exits the UI, how the application can still run in the background and keep sending these messages.

A Windows service or a Linux daemon might be the solution?

Thanks

George

[577 byte] By [gvagenasa] at [2007-11-27 6:12:45]
# 1

Simple. Don't put all your code in the UI. Make your UI actually be just an interface into your application, rather than actually being the application

A service or a daemon thread could be appropriate, but the important thing - almost always, not just in this instance - is to keep your UI code decoupled from the core of the application

You can see how well you're doing by writing more than one interface. If you find you have to alter the core code to fit another UI over it, your layers are leaking

georgemca at 2007-7-12 17:20:18 > top of Java-index,Java Essentials,New To Java...
# 2

georgemc ,

Thanks for your reply, so you mean to have multiple layers in my application, and the UI to just implement the interfaces i declared in the core applicaton, right? So if this is a web application, the core functionality is always running and whenever the user wish just bring in front the UI?

Thanks

gvagenasa at 2007-7-12 17:20:18 > top of Java-index,Java Essentials,New To Java...
# 3

> georgemc ,

>

> Thanks for your reply, so you mean to have multiple

> layers in my application, and the UI to just

> implement the interfaces i declared in the core

> applicaton, right? So if this is a web application,

> the core functionality is always running and whenever

> the user wish just bring in front the UI?

>

> Thanks

Yeh. Layers are good. Don't be misguided into thinking those extra calls will make your application horrendously slow, just write good clean OO code and let the JVM do the heavy lifting

georgemca at 2007-7-12 17:20:18 > top of Java-index,Java Essentials,New To Java...