Hi,
A programming basic quest :
When to go with instance methods and singleton classes(I mean taking a static object of the class and use it all over the application).
To be clear, I have some methods which have the generic functionality (getting substring , height of the string, validating string is numeric or not... etc).
Now I can do in both the ways, but stuck on which way to go. I would prefer to go with singleton class object, because AFAIK it would allow me to access non-static variables too.
Please let me know which is the best way to go (other than the usage of non-static variable scenario).. memory and code size , performance issues.. or experience you had in reference to better code.
Also in reference to OBJ-C.
Thanks,
Pramod Jain
A programming basic quest :
When to go with instance methods and singleton classes(I mean taking a static object of the class and use it all over the application).
To be clear, I have some methods which have the generic functionality (getting substring , height of the string, validating string is numeric or not... etc).
Now I can do in both the ways, but stuck on which way to go. I would prefer to go with singleton class object, because AFAIK it would allow me to access non-static variables too.
Please let me know which is the best way to go (other than the usage of non-static variable scenario).. memory and code size , performance issues.. or experience you had in reference to better code.
Also in reference to OBJ-C.
Thanks,
Pramod Jain