File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Question about Design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Question about Design" Watch "Question about Design" New topic
Author

Question about Design

Amer Seifeddine
Ranch Hand

Joined: Apr 25, 2002
Posts: 57
Hello,

I am wondering which design would be better than the second for a business appliation managing user sessions (active/inactive etc):

1- Leave incoming threads to interact with sessions/database
2- Have internal threads managing incoming threads and serve their requests? How would I do that?
3- Any other idea is welcome.

Thanks!
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
3a. Use a framework that handles sessions and threading for you. Learn how to use it. Then worry about your business issues, and less on threading and sessions.


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Amer Seifeddine
Ranch Hand

Joined: Apr 25, 2002
Posts: 57
I am trying to build my own framework along with the business application.
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Originally posted by Amer Seifeddine:
I am trying to build my own framework along with the business application.


The great thing about open source projects is that the source is available to actually look at. Pick a couple of existing frameworks you like, and look at their source code to see how they handle it. What do you feel you need to do differently?

You can learn a lot by reading source code. One of my favorite tech bloggers, Scott Hanselman, does a weekly source code post where he talks about what he learns from reading the source of different types of applications. Great stuff for developing your own skills.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Originally posted by Amer Seifeddine:
I am trying to build my own framework along with the business application.


As a mental game, thats cool. But life is too short to re-write code that someone else has designed, written, tested, and documented.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about Design