Forums Register Login

new instance per user

+Pie Number of slices to send: Send
Hi

I have some idea, anydody please suggest how to implement this.

In any web application or enterprise application, to handle many users
I like to design a context or platform which is unique for a user ,no users can see others context ,Each context has unique context ID, to access the context ,ID should be gven. In context I will place the data which is not intended to share with others. If many users access the same object then ,new instance should be created ,then placed in the particular context.

Please suggest any plus and negative of this ?
+Pie Number of slices to send: Send
Ii might be missunderstanding you, but you are describing something quite similar to a HttpSession..

Maybe you should dive deeper into the Servlet API before reinventing the wheel.

Regards,
Uli
+Pie Number of slices to send: Send
If it is servlets, you should start with our servlets forum FAQ.
+Pie Number of slices to send: Send
You can also take a look at the Java EE Tutorial's section on The Web Tier which discusses Servlet's and the life cycle of a client (i.e. a user). From there you can look at one of the many fine Java Servlet/JSP books on the market.
+Pie Number of slices to send: Send
 

but you are describing something quite similar to a HttpSession..


yes I agree ,But expert suggest me that do not use Http session object or use as less as possible.So I forced to take that concept.
+Pie Number of slices to send: Send
 

Originally posted by jacob deiter:

yes I agree ,But expert suggest me that do not use Http session object or use as less as possible.So I forced to take that concept.



Sorry, but I have to ask what "expert" suggested this? What were his/her reasons for not using the Java HTTP Session API?

Why would you not want to use an API that has been successfully used, tested, documented, and perfected by millions of developers worldwide to do exactly what it is you want to do? An API written by experts in the HTTP protocol and RFC. An API that mutibillion dollar enterprises run their business off of. An API whose functionality you get for free in any of the dozen or more Java EE compliant web and application servers. Why would you -- or the expert advising you -- think it would be easier or better to write your own code to handle this complex task? Why would you want to spend the time doing such?

I can guarantee you that all the experts on this forum (including myself) would advise you to use it and not to try and write your own. Start a thread in the Servlets forum asking that question and see what results you get.

The other advantage to using the Java HTTP Session API is that when you need to bring additional developers onto the project to help (or turn it over to them), they are far more likely to know the HTTP Session API than a custom one you have written. This only makes sense. And if they don't know it, there are dozens of books and tutorials they can reference rather than you having to document and teach them the API you wrote. In other words, it will make your application easier and cheaper to support and maintain. You always want to think about the long term implications of the design decisions you make.
Tell me how it all turns out. Here is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 763 times.
Similar Threads
long post IBM.158
a unique context should be created for each user
Difference. between ServletContext and Session Attributes
000-341 sample test questions
Passed Part One with 87%
why use of JTA in the Web tier is not recommended?
Resources for WAS
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 03:13:37.