Yes but the GetResource code you posted does approx the same as the built in GetTextResource(key, defaulttext), except that GetTextResource only generates object not set to instance when fired outside of controller (as far as ive tested anyhow, modulesettings does the same).
Regarding the last example you posted it takes the kooboo resources into a cache correct? Im not really to worried about the overhead regarding the fetchtimes from kooboo though. What i wanted was:
What i wanted to avoid:
Code:Controller1
GetTextResource("KEY1", "STRING1");
Controller2
GetTextResource("KEY2", "STRING2");
Controller3
GetTextResource("KEY1", "STRING1");
GetTextResource("KEY2", "STRING2");
What i was after:
Code:Controller1
GetTextResource(key1, string1);
Controller2
GetTextResource(key2, string2);
Controller3
GetTextResource(key1, string1);
GetTextResource(key2, string2);
Some class
parentfolder = "Setings.";
key1 = parentfolder + "KEY1";
string1 = "STRING1";
key2 = parentfolder + "KEY2";
string2 = "STRING2";
Or that the static class contained the affected resources directly, setting them there. It could be perhaps const like above or dicionary item or other. Though your cached example would be nice to but using that as is would mean i still have to set the properties somehow thus initializing / creating the resources. SO what i was after was to never set static strings in the controllers, the key and defaultvalue in the gettextresource and your getresource functions being suchs strings.
Since my plan is to reuse atleast some of the resources settings and setting the same string values on multiple resource calls seems bad and makes it hard if i where to change values or translate to other language later on for example.
THOUGH with that said i think a cached dictionary containg the static strings seems like a nice option but question is if it where to make any practical difference compared to for example just placing all strings in a class, fetching them when needed.