We are developing a Flex Application with PHP as a middleware. Flex Httpservice component we are using to communicate with the PHP. We have several developers who are doing separate modules. They doing both Flex as well as PHP code. I thought its not proper and need to have a solution where our code will reside on the single url.
How we achieve this?
I thought of developing a architecture which will take a className and methodName from URL and call methods and the supplied object dynamically.
This above url calls getUser method on MyClass Object. I used call_user_method function of PHP which allows me to achieve this.
One trick for this part is also instantiating the object dynamically. I coded like this
static $instance ;
$instance =& new $class;
getObject method accepts className and checks wheather that object exists or not. If object is not set then it creates a object and just return it.
It was a great experience while building something which allows my developers to simplify their code integration. Now every developers is working on their respective classes and using this method.