Thanks so much for the reply, I really appreciate it. I'm new to Java but not new to SF, I need help.
Ok, so the "recommended" way is actually the only way possible? It's not possible to do your entire extension in one class/package as is possible in SF Pro/ javascript? Ok.
I'm new to Java, but it seems similar to C#. One reason I wanted to do everything in one class is because I can't figure out how to communicate efficiently between classes without instantiating new instances all over the place. For example, to do a custom login you have to make a LoginEventHandler class. My main extension sets the event, and I know there is already an instance of the class because it traces out on init. When I ask the SF message board how to send messages to that class, they say I have to instantiate a new class and save that reference in a variable. I don't want to do this because clearly I have an instance already made on startup of the extension. I don't want tons of extraneous instances all over the place, plus it would be nice to let the classes have persistent global variables without instances conflicting with each other? If I had everything in one class this would not be an issue.
In Java + SF, If I can't keep all my events in one class, is there a way to call a function in an already-made-class without instantiating another instances of that class?
For example, in my main class called "TidesMainExtension" I have a function called "traceOut" that simply traces things...
Is it possible, from another class, to do something like:
Code: Select all
Class c = TidesMainExtension.class;
c.traceOut("testing...");
The above code doesn't work, but is there something like that, that would work?