I'm developing a Web App.
Until now the backend was JBoss 6.1 Application Server (Java EE).
Now, with the same frontend, there should be another backend in PHP.
As I like the structure of the Java Backend, I design a similar structure for the php backend.
EVERY request to the PHP backend goes to ONE entry, it's "facade.php", it is my front controller.
The front controller (facade.php) handles the JSON input and other things and then there is a large switch statement. Every task (login, get event objects, ...) is transferred to another process class.
Snippet of "facade.php":
switch ($procClass) {
case "lgi":
require_once("classes/Login.php");
$login = new Login();
$resultMap = $login->process($internalObj, $sessionObj);
break;
case "cst":
require_once("classes/Cases.php");
$cases = new Cases();
$resultMap = $cases->process($internalObj, $sessionObj);
break;
.
.
.
}
In the JBoss Java EE environment, when I am in an Stateless Session Bean and I do a local look up to another Stateless Session Bean (different classes), the objects are handed to the method of the other class BY REFERENCE.
Now I know that, in PHP, when you are in the same class and you pass one object to another method of the same class, the object is passed per reference (or more accurately the reference is passed by value).
But, as in the example above, if I pass the "sessionObj" object from facade.php to the instance of another class (cases), which is in another file, it seems that it is NOT possible to pass objects per reference.
Is my assumption correct?
Is there another way to pass per reference in this situation (from object to object when the classes in separate files)?
$sessionObjshould already be passed by reference to theprocessmethods. You sure there wasn't any error in yourprocessmethod?