Print Page | Close Window

[Resolved] using PooledNumericIdGenerator

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=500
Printed Date: 11-Jun-2026 at 4:35pm


Topic: [Resolved] using PooledNumericIdGenerator
Posted By: orcities
Subject: [Resolved] using PooledNumericIdGenerator
Date Posted: 15-Oct-2007 at 11:57am
I would like to use the PooledNumericIdGenerator.
 
What would be the best way to implement this?
 
The NumericIdGenerator is built into the core. And, as far as I can tell it is not something I can override.
 
If I add it to my solution which will be used, since there will be to IIdGenerator classes?



Replies:
Posted By: Linguinut
Date Posted: 15-Oct-2007 at 12:51pm
Only one or the other can be used...I don't think both can be used at the same time.  If both existed, I would guess that the NumericIdGenerator would be the default.
 
I use the PooledNumericIdGenerator.  Works quite well in the CAB app; however, I spent a gob of time getting it to work outside of the CAB app.  It took me a while to figure out the best way to use it.  I did write a bunch of forum entries along the way (with David K.).  They should still be available.
 
Moving it over was basically a drag and drop exercise.


Posted By: orcities
Date Posted: 15-Oct-2007 at 12:56pm
I am kind of wondering if recompiling the Cab Lib is the best option. Then I have to keep up with the upates.
 
If this is the case maybe there is a way to choose which IIdGenerator you wish to use in FoundationModule class in the future.
 
 


Posted By: Linguinut
Date Posted: 15-Oct-2007 at 12:58pm
I don't think it is part of the LIB (core).  The classes are part of the Model project.  Implementing one or the other is a matter of building the model with one of these classes.


Posted By: orcities
Date Posted: 15-Oct-2007 at 1:01pm
The only place I found it implemented was in the IdeaBlade.Common.EntityModel. Which is in the core.


Posted By: Linguinut
Date Posted: 15-Oct-2007 at 1:17pm
There is a sample solution somewhere (I cannot find it at the moment) that walks through an implementation of the PooledNumericIdGenerator.  It is quite good.  I can attest that the pooled generator works in CAB without any tweaking.  You should not have to touch the LIB source, at all.


Posted By: orcities
Date Posted: 15-Oct-2007 at 1:20pm
The NumericIdGenerator is implemented already in the core (IdeaBlade.Common.EntityMode).
 
So are you saying you have added it to you solution and it is using that one?
 
 Cause if you are that means that you have to IIdGenerator class instances and it is using the one in your solution rather then the one in the core.


Posted By: Linguinut
Date Posted: 15-Oct-2007 at 1:32pm
The PooledNumericIdGenerator inherits from IIdGenerator, if that's what you mean.


Posted By: orcities
Date Posted: 15-Oct-2007 at 1:35pm
I realize that. But, we currently alread have one in our solution. It is in the IdeaBlade.Common.EntityModel. 
 
If you have it in your solution where do you have it?
 
Bill J. please chime in.


Posted By: Linguinut
Date Posted: 15-Oct-2007 at 1:43pm

The PooledNumericIdGenerator.cs is a separate class file that resides within the Model project.  There is an example of this in one of the IdeaBlade tutorials.  I basically copied the file and pasted it into my model project.  There are a good set of comments within that file that will help you get things setup correctly.



Posted By: orcities
Date Posted: 15-Oct-2007 at 1:48pm
We are going around in circles.
 
What I am trying to say is that it is already exists in the Core. Under the IdeaBlade.Common.EntityModel which is referenced in the Model project.
 
But, from what you are saying it can also be in the Model.
 
I will put the Pool class in the Model until someone says there is a better place for it.
 
tx Linguinut


Posted By: Linguinut
Date Posted: 15-Oct-2007 at 2:02pm
Originally posted by orcities

What would be the best way to implement this?
 
Not trying to get you to use red letters, just trying to answer your question.  I think I did--sorry for not being more clear.  Read the comments in those files (NumericIdGenerator.cs and PooledNumericIdGenerator) for more information.


Posted By: Bill Jensen
Date Posted: 15-Oct-2007 at 2:05pm

If the NumericIdGenerator supplied with Cabana in the IdeaBlade.Common.EntityModel assembly doesn't do what you want, you can write your own and put it in your Model assembly.  Your implementation may or may not (your choice) inherit from NumericIdGenerator.

DevForce decides which one to use by searching the probe assemblies listed in your IdeaBlade.ibconfig file.
 
Bill J.


Posted By: orcities
Date Posted: 15-Oct-2007 at 2:06pm
So I take it that it searches our currently assembly first?


Posted By: orcities
Date Posted: 15-Oct-2007 at 2:07pm
Sorry, they really didn't need to be read I just chose a color. I was just trying to highlight that I understood all of that. I understand where it is suppose to go and how to use it.
 
But, I was wondering since it is already part of our solution, as a ref, if it can still be or should still be put in the Model project.



Print Page | Close Window