I am working on a little project that I want to be able to run either
as a Swing app or a web app. I need to use something for session
management either online or offline and was wondering if there are any
negative ramifications to using an object that implements HttpSession
if I'm not using it within a J2EE web container. I'd like to be able
to use HttpSession because that way I can write code once that will
work either in a web app or in a desktop app.
If this is a stupid idea, let me know. :)

Signature
Steve Sobol, Professional Geek ** Java/VB/VC/PHP/Perl ** Linux/*BSD/Windows
Victorville, California PGP:0xE3AE35ED
It's all fun and games until someone starts a bonfire in the living room.
Arne Vajhøj - 26 Mar 2007 02:45 GMT
> I am working on a little project that I want to be able to run either
> as a Swing app or a web app. I need to use something for session
[quoted text clipped - 5 lines]
>
> If this is a stupid idea, let me know. :)
The side effects of implementing an interface should be minimal.
But I do not like the idea. Every maintenance programmer that
will be reading your code will ask: WTF is going on here ?
Arne
Steven J. Sobol - 26 Mar 2007 20:08 GMT
>> If this is a stupid idea, let me know. :)
>
> The side effects of implementing an interface should be minimal.
>
> But I do not like the idea. Every maintenance programmer that
> will be reading your code will ask: WTF is going on here ?
Now I'm thinking it'll probably be simpler to create an object to hold all
of the information I need for a specific session, and then store that
object in an HttpSession if my code is running on the web...

Signature
Steve Sobol, Professional Geek ** Java/VB/VC/PHP/Perl ** Linux/*BSD/Windows
Victorville, California PGP:0xE3AE35ED
It's all fun and games until someone starts a bonfire in the living room.
Daniel Pitts - 26 Mar 2007 21:24 GMT
> In article <460725b6$0$90276$14726...@news.sunsite.dk>, Arne Vajhøj wrote:
> >> If this is a stupid idea, let me know. :)
[quoted text clipped - 7 lines]
> of the information I need for a specific session, and then store that
> object in an HttpSession if my code is running on the web...
Sounds like the way to go.
Daniel Pitts - 26 Mar 2007 03:21 GMT
> I am working on a little project that I want to be able to run either
> as a Swing app or a web app. I need to use something for session
[quoted text clipped - 11 lines]
>
> It's all fun and games until someone starts a bonfire in the living room.
I would look into "Spring Web Flow". its part of the Spring
Framework. Don't be fooled by the "Web" in the title, its designed to
work well with many types of MVC frameworks, including Swing.