User1146730029 posted
Maybe the best way to explain what I want to know if via an example.
Lets say I have a website for cars. The obvious thing is to create a cars class e.g. clsCars. In this, I have properties that define the make, colour, engine, etc. I instant this class for a new car, or for loading an existing car.
Now I have a search page where the user can select the make, colour, engine size, etc. from drop down lists (ddl). I need to load these ddls from the database.
The obvious place to put the code to load the ddls is in the clsCars class. However, I do not want to instance the clsCars class just to load values into the ddls.
So I make the functions that retrieve the values for the ddls as shared functions.
My question is, is the correct design? Will I have problems with using shared functions? i.e. what happens when multiple users call the same function, how long does the shared function reside in memory, is there advantages/disadvantages to this?
(Sorry for the noob question!)