|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Optimizing a Factory PatternI'm looking for some advice from more experienced .netters. I would
like to use a Factory Pattern that accepts an ID number and returns an object. As I may have a large pool of objects to choose from, I'm trying to figure out the best strategy in retrieving the needed object. The application is a stand-alone client. I'm considering a hashtable that would populate at start-up. The key would be the ID and the value would be the object. Each object would contain about 20 properties/members. Eventually, the number of objects could reach about a hundred--possibly more. Anyone have comments about this approach? Thanks, Eric Eric -
Your idea of hash table looks ok but, consider this: lets say your application reaches its peak, creating all the objects and populating the hash table. Would that slow your application? Did you consider creating not so frequently used objects when there is a need through the factory instead of storing them? HTH I was just wanting to avoid a huge select case statement. I saw a
similar thread in the groups and someone recommended using Activator. The class--not the hair product. If I have ID 2000100, I want to create Object1. If I have ID 2000200, I want to create Object2, etc. So, yes, I'd like to avoid creating this huge hashtable full of objects if it would slow it down, but I'm not sure of the best way to do this. E
Where can I find Interop.MAPI.dll
Q: DataGrid Select Shutdown a list of computers using VB.net Need equivalant code in VB.Net 2005 ? "friend" accessor and inherited forms Waht is the fastest/bets? Outlook Object/CDO/Redemption/...? Data types DatagridviewComboboxColumn Calling all (any?) NDoc'ers Multicolumn Listbox |
|||||||||||||||||||||||