PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: sectore on June 22, 2008, 02:20:46



Title: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: sectore on June 22, 2008, 02:20:46
HelloPipes (http://www.websector.de/blog/2008/06/21/a-basic-puremvc-multicore-as3-example-using-pipes-utility-and-modules/) is a simple application which loads and unloads a module for communicating with its shell using Pipes Utility. Module and shell are acting as a Core based on PureMVC MultiCore AS3. You will find there (http://www.websector.de/blog/2008/06/21/a-basic-puremvc-multicore-as3-example-using-pipes-utility-and-modules/) some tips using Modules, PureMVC MultiCore AS3 and Pipe Utility as well.

- Live Demo (http://www.websector.de/blog/wp-content/uploads/2008/06/21/HelloPipesShell.html)
- Download full source (http://www.websector.de/blog/2008/06/21/a-basic-puremvc-multicore-as3-example-using-pipes-utility-and-modules/) (search for "Full source" within blog post)

Any feedback are welcome!

-Jens



Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: kouri on October 19, 2009, 10:04:35
Hi Jens

Thank's a lot for this clear skeleton. I now base my projects on it (...thx to Tek and Cliff too  ;-) )

The only change I'd do is moving each module's main mxml from project root (/src)
to their own /view package instead.

Unfortunately as soon as I do it in Flex Builder, the generated swf is then misplaced and shell app does not find it anymore. Moreover when I set up module's properties in <Project>/Properties/Flex Modules windows,  the path of [Output SWF] is in a read-only textbox.

Any idea how to fix this ?




Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: puremvc on October 19, 2009, 10:10:39
Usually at this stage, it's time to look into creating an ant build script.

-=Cliff>


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: kouri on October 19, 2009, 11:37:26
You're right,Cliff !

Ant is like h1n1 flu vaccine: we don't wAnt but... 

:)


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: kouri on October 26, 2009, 01:38:26
That may be OT but could help whose like me are setting up an ant builder for sectore sample-like app.

I use the mxmlc task included with the Flex 3 SDK (flexTasks.tasks) but my ant script fails to compile a module swf because it can't get access to IPipeAwareModule.as file in common rep.

Here the msg I get:
Buildfile: D:\myproject\build\build.xml
loginmodule:
    [mxmlc] Loading configuration file C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.4\frameworks\flex-config.xml
    [mxmlc] D:\myproject\src\com\myproject\modules\loginmodule\view\LoginModule.mxml(4):  Error: Interface IPipeAwareModule was not found.
    [mxmlc]    implements="com.myproject.common.IPipeAwareModule"


Thanks in advance if an ant-expert can tell me what is missing ?


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: puremvc on October 26, 2009, 03:53:01
I can't tell you much from this. What do you mean by common rep? Is your common stuff in another folder or in a swc?

If they are just in another folder, you probably need to add a source-path path-element tag.

If they're in a swc (they should be) then you probably need to add a compiler.external-library-path tag. You should create separate targets for compiling the common swc and the applications that use it.

-=Cliff>


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: kouri on October 26, 2009, 04:46:22
Thx for your help!

The /common directory contains IPipeAwareModule.as and PipeAwareModuleConstants.as  (these 2 files are provided in sectore sample so I assume they're not in a swc)

Yes I added a source-path path-element inside mxmlc tag but same result  :(
and yes I have actually 2 targets:

<project...  basedir=".." default="shell" >
    ...
    <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
   
    <target name="loginmodule" >
       <mxmlc file="${MODULE_ROOT}/loginmodule/view/LoginModule.mxml" output="${DEPLOY_DIR}/LoginModule.swf" >
              <source-path path-element="${COMMON_ROOT}" />
              <source-path path-element="${MODULE_ROOT}/loginmodule" />
       </mxmlc>
    </target>
   
    <target name="shell" depends="loginmodule">
       ...
    </target>
</project>

Still searching....as you convinced me that it's a missing path somewhere.


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: puremvc on October 27, 2009, 08:22:23
Actually, for real-world use, you'd want at least 3 targets: shell, loginmodule and common. The common target would compile the common code to a swc, then shell and loginmodule targets would both use that swc.

-=Cliff>


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: kouri on October 31, 2009, 09:05:35
Cliff,
My build works just fine now ! I misunderstood the meaning of somes Ant parameters so I completely rebuilt all my paths and doublechecked correspondence between the ones defined through properties and those passed in arguments.


One last question: as /common directory only contains classes (not intended to be delivered); what's the interest to make a swc ?


Title: Re: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules
Post by: puremvc on November 02, 2009, 08:32:40
Well with a "hello world" project, sure it doesn't matter. But for "real world" projects it's a good way to go. It allows you to maintain control of the common code separate from the application and its modules.

For instance, you might have contractors working on some modules, but you want to limit their access to just the repositories for their projects. You might not want them looking at the common code, perhaps for intellectual property reasons. Or perhaps you just to keep them from accidentally messing it up and breaking the build during a critical development phase.

The module developers just use the library as proscribed. Their project has the compiled, common swc, just as they have the PureMVC swc to add those classes.

BTW, I just illustrated this in an adjacent post: http://forums.puremvc.org/index.php?topic=1516.msg6864#msg6864

-=Cliff>