Accessing pooled object from web application

Dear Friends
   I need guidance for below problem
 A win app which should instantiates say 5 object in an ary.And a web application residing in the same machine should access the objects from the memory.when 'user A' logsin the web app should search for  available free object(out of 5) from the memory and that object must be locked until unless 'user A' logsout in between if 'user B' logsin it should search for free object(out of 4) .At a time 5 user should access 5 differrnt object  
thanks in advane

Dees
deesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SystemExpertCommented:

use constucter of that class and with the help of  variable you can keep track of those object
AGBrownCommented:
There are lots of ways to implement a pool, but the real problem is sharing the objects between two different applications on the same machine. I have to say I don't know a simple way of doing that.

One solution (not simple) will be to implement a Remoting service on IIS. This will host the pool as a Singleton object (an object of which there can only ever be a single instance of in a given application space). Your pool will be a collection of the objects that you want to pool. Each of these will be stored along with a flag that indicates if they are free or not. You will also need to implement some kind of pool manager that will maintain the pool and solve problems such as permanently checked-out objects caused by application crashes etc.

This is not a simple problem, and therefore it won't have a simple solution, but with a little persistence you will be able to pull it all together. I couldn't find many good background articles, so I would first read up on what a singleton design pattern is:
http://www.dofactory.com/Patterns/PatternSingleton.aspx

Then have a look at this for an idea of one method for implementing a singleton in .NET on IIS:
http://www.codeproject.com/dotnet/ShareObjDotNet.asp

If you think you can do all that, then you need to design your pool. You can use System.Collections.CollectionBase as the base of the collection that will hold you pooled objects, but you will need to do something along the lines of storing a wrapper class that will also store attributes such as CheckedOut, TimeOfCheckOut, UserWhoCheckedOut etc. Finally you need to decide on your pool management strategy, and design a timer-based class that is created with the pool and that looks after the pool.

Andy

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.