A 'Best Practices' Question on Components
LET'S SAY I HAVE 2 FOLDERS...
Framework Components - Holds components that are used across multiple web applications which are setup to use the framework.
Application Components - Holds components designed for specific web applications (not global in it's functions)
In short, think of owning a Pizza store and a Burger store. A method called "OrderIngredients" would exist in the "Framework Components" folder, because both stores (web apps) would utilize it. However, the function "MakePizzaSlices" would be in the "Application Components" folder of the Pizza web app only, since there's no need for it to be in other web apps (that don't make pizza)
So here's the thing. The FW COMS folder has about 12 coms, totaling about 542KB of code. The APP COMS folder (for this particular app) has 4 files totaling 88KB.
SO HERE'S MY QUESTION...
Performance-wise, have you found it better to just instantiate everything into the APPLICATION scope onApplicationStart so that code can reference this whenever it wants without having to check for whether it has been instantiated yet? Or do you prefer instantiating the components on an 'as-needed' basis?
For the former, any REQUEST-based component, such as template generation, could be instantiated off the component in the APPLICATION scope and exist for just the duration of the REQUEST. I'm just looking for what isn't going to overload the server. Hopefully holding <1MB of data in memory for the duration of the Application's timespan is OK.
