Hi,
I have been agonizing some time already that C2 isn't supporting "precompiled" C2 Layout/Event components and modularity -- what i believe to be a prerequisite to developing clean, reusable and scalable source code.
But, I believe that I found a way to achieve it using adaptations of currently existing plugins. I would like to find someone with plugin development experience with whom I could jointly develop this to be shared in the C2 community.
Here is the overall approach that seems to work:
1. C2 would could be complied and then embedded in a C2 Project layout using Pode iFrames.
2. Communication between the C2 project and project included in the IFrame would occur using HTML5 messaging such as implemented in the Pode's PostMessage plugin, which can send and receive message in event sheets using iFrame IDs.
The C2Embedding plugin would offer additional features:
1. the C2 project that embeds another project would provide the project a unique ID, which is then used in subsequent messaging to direct messages to the correct embedded iFrame C2 project . This could be provided as a parameter in the URL that links to the IFrame of the embedded C2 project would.
2. a Dictionary could be used to specify the data interface between the main project and the embedded project. The Variable Dictionary would include "global" variable names in the embedded project that could be set or changed, which would then be reflected in the embedded C2 project.
3. An Event trigger Dictionary could be used to indicate the events triggerable in the embedded C2 project -- or, in case of a lighter approach: an event with tag could be used to trigger events within the C2 project.
4. the embedded C2 project could trigger events in the main project. A tags could indicate the event kind triggered.
this is it, in essence.
Having such a capability, would allow compiling C2 projects into "components" and have those components embedded and integrted in other C2 projects.
i feel this could be very useful in better managing projects.
Dan
p.s. more thinking needs to be done to support special platforms such as node web-kit, how these access, load and run pre-compiled components in iframes.