Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: HelloPipes - a basic Demo using MultiCore, Pipes Utility and Modules  (Read 14688 times)
sectore
Courseware Beta
Full Member
***
Posts: 29



View Profile WWW Email
« on: June 22, 2008, 02:20:46 »

HelloPipes 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 some tips using Modules, PureMVC MultiCore AS3 and Pipe Utility as well.

- Live Demo
- Download full source (search for "Full source" within blog post)

Any feedback are welcome!

-Jens

Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #1 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 ?


Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: October 19, 2009, 10:10:39 »

Usually at this stage, it's time to look into creating an ant build script.

-=Cliff>
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #3 on: October 19, 2009, 11:37:26 »

You're right,Cliff !

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

:)
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #4 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 ?
« Last Edit: October 26, 2009, 02:51:16 by kouri » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 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>
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #6 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.
« Last Edit: October 26, 2009, 04:51:37 by kouri » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #7 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>
« Last Edit: October 29, 2009, 07:00:31 by puremvc » Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #8 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 ?
« Last Edit: October 31, 2009, 09:07:27 by kouri » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #9 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>
Logged
Pages: [1]
Print