Click here to Skip to main content
15,867,594 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# API for converting XSL-FO to PDF and other formats Pin
Stephane Rodriguez.23-Oct-02 21:28
Stephane Rodriguez.23-Oct-02 21:28 
GeneralRe: c# API for converting XSL-FO to PDF and other formats Pin
Philip Fitzsimons24-Oct-02 6:32
Philip Fitzsimons24-Oct-02 6:32 
Generalquestion about override and accessing base class methods Pin
Marc Clifton23-Oct-02 8:30
mvaMarc Clifton23-Oct-02 8:30 
GeneralRe: question about override and accessing base class methods Pin
Mark Conger23-Oct-02 10:09
Mark Conger23-Oct-02 10:09 
GeneralRe: question about override and accessing base class methods Pin
Jon Rista23-Oct-02 18:42
Jon Rista23-Oct-02 18:42 
GeneralRe: question about override and accessing base class methods Pin
Mark Conger24-Oct-02 1:47
Mark Conger24-Oct-02 1:47 
GeneralRe: question about override and accessing base class methods Pin
Jon Rista26-Oct-02 10:27
Jon Rista26-Oct-02 10:27 
GeneralCollection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 0:38
sitebuilderPaul Watson23-Oct-02 0:38 
I have a class collection which contains another collection which contains another collection etc.

-StockCollections[]
    -StockCollection
        -StockItems[]
            -StockItem
                -StockItemColours[]
                    -StockItemColour
                -StockItemSizes[]
                    -StockItemSize


Pretty simple structure really, just a bit deep.

In the constructor of each collection ([]) class there is some code which queries the database and populates the collection with items.

Now this may sound stupid to you, but I just need to know something: When I construct that top level StockCollections[] collection are all other sub-items and sub-collections also "activated" and populated? Or does it only populate the sub-collections when they are "called" (for instance in a foreach loop (thanks to Nish for the IEnumerable code Big Grin | :-D ).)

If that is the case then I have a problem (as you already guessed) as there may be up to 100 000 StockItems each with 10 to 20 Colour and Size options. Now if all I wanted was the titles of the items in the StockCollections[] collection then that is a huge amount of uneeded overhead.

Do you have any advice as to how you stop this happening? Or do I have to have two constructors for each collection, one which takes a parameter specifying not to load sub-items?

Any advice welcome, thanks Smile | :)

Paul Watson
Bluegrass
Cape Town, South Africa

GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Riley23-Oct-02 0:52
Paul Riley23-Oct-02 0:52 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 1:19
sitebuilderPaul Watson23-Oct-02 1:19 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Riley23-Oct-02 1:26
Paul Riley23-Oct-02 1:26 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Riley23-Oct-02 1:32
Paul Riley23-Oct-02 1:32 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 0:53
James T. Johnson23-Oct-02 0:53 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 1:13
sitebuilderPaul Watson23-Oct-02 1:13 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 1:20
James T. Johnson23-Oct-02 1:20 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 1:59
sitebuilderPaul Watson23-Oct-02 1:59 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 2:28
James T. Johnson23-Oct-02 2:28 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 3:12
sitebuilderPaul Watson23-Oct-02 3:12 
GeneralRe: Collection within a Collection and "loading" advice Pin
James T. Johnson23-Oct-02 3:26
James T. Johnson23-Oct-02 3:26 
GeneralRe: Collection within a Collection and "loading" advice Pin
Daniel Turini23-Oct-02 1:23
Daniel Turini23-Oct-02 1:23 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 2:05
sitebuilderPaul Watson23-Oct-02 2:05 
GeneralRe: Collection within a Collection and "loading" advice Pin
Daniel Turini23-Oct-02 2:22
Daniel Turini23-Oct-02 2:22 
GeneralRe: Collection within a Collection and "loading" advice Pin
Jon Rista23-Oct-02 18:33
Jon Rista23-Oct-02 18:33 
GeneralRe: Collection within a Collection and "loading" advice Pin
Paul Watson23-Oct-02 21:19
sitebuilderPaul Watson23-Oct-02 21:19 
GeneralRe: Collection within a Collection and "loading" advice Pin
Jon Rista27-Oct-02 17:48
Jon Rista27-Oct-02 17:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.