On 02/07/2005, at 1:03 AM, Nathan Walker wrote:
I have these declarations all over:
Session sess = (Session)session();
In order to set things in the current session. I know I could create a superclass with that in it and just have all my components subclass that but seems unneccessary. Am I missing something here. I use this in the Direct Action class a lot to. Do I really have to declare that at the top of all my class files that I intend to reference my session object? It seems so common to set stuff on the current session. There must be someway else..
This is a product of Java's strong typing :-/, so yes you'll need to (cast) from the inherited method unless you roll your own.
Alternatively, try using using the NSKeyValueCoding interface... (at least for instance methods/variables) e.g.,
session().valueForKey("methodOrVariableName");
session().takeValueForKey(someObject, "methodOrVariableName");