tecknoize
August 8th, 2007, 03:06 PM
Hi guys,
I'm working on a project at work that I can't much talk about, but I would like to know your thoughts and ideas about the way it's build.
So basically, it's some kind of a Player/Played relation, where I have a main "Player" that provide some services to the "Played". Both are separated SWF, and the Played SWF is loaded inside the Player SWF.
That's all pretty easy to do, but I'm stuck at the communication level. I don't want to include all the player classes inside the "played", because it's just plain wrong. It would be like embedding the Flash Player inside your SWF... Player update = your SWF is crap.
So I thought : "Well, you need some kind of interface that you could include in your played swf, and have the Player implement that."
At first, that seems to be the best thing in the world after Astro Boy's robot dog. But after working hard on it, I began to see some failure, like the impossibility to create instance of classes, and use factory methods instead : createThis(), createThat(), etc. I think it would be wrong to have a major "PlayerFactory" class to create all concrete classes of the player. And what about static members? can't do that either using Interfaces...
I don't know what to do to keep it clean and simple. :crying:
To sum it all up, I want a good communication bridge between the Player and the Played. I obviously also want to keep the player's code inside the player.
Please share your thoughts and opinions!
Thanks! :azn:
PS: Sorry If my thread sound like a HELP! DO THIS FOR ME thread. That's not my intention. I would like you to read it as a "hey, let's discuss this".
I'm working on a project at work that I can't much talk about, but I would like to know your thoughts and ideas about the way it's build.
So basically, it's some kind of a Player/Played relation, where I have a main "Player" that provide some services to the "Played". Both are separated SWF, and the Played SWF is loaded inside the Player SWF.
That's all pretty easy to do, but I'm stuck at the communication level. I don't want to include all the player classes inside the "played", because it's just plain wrong. It would be like embedding the Flash Player inside your SWF... Player update = your SWF is crap.
So I thought : "Well, you need some kind of interface that you could include in your played swf, and have the Player implement that."
At first, that seems to be the best thing in the world after Astro Boy's robot dog. But after working hard on it, I began to see some failure, like the impossibility to create instance of classes, and use factory methods instead : createThis(), createThat(), etc. I think it would be wrong to have a major "PlayerFactory" class to create all concrete classes of the player. And what about static members? can't do that either using Interfaces...
I don't know what to do to keep it clean and simple. :crying:
To sum it all up, I want a good communication bridge between the Player and the Played. I obviously also want to keep the player's code inside the player.
Please share your thoughts and opinions!
Thanks! :azn:
PS: Sorry If my thread sound like a HELP! DO THIS FOR ME thread. That's not my intention. I would like you to read it as a "hey, let's discuss this".