Pure MVC

Discuss how to apple design patterns

Pure MVC

Postby shunjie on Thu Apr 03, 2008 5:20 am

I am currently looking at Pure MVC. Actually I still prefer Caingorm and I still think Pure MVC is..er..weird :D

Anyone can give me a reason why we should use PureMVC over Cairngorm for a Flex project?
User avatar
shunjie
 
Posts: 229
Joined: Wed Oct 17, 2007 6:05 am

Re: Pure MVC

Postby flashmech on Fri Apr 25, 2008 4:15 am

Hmmm... I think PureMVC is made more generic? So that you can use it for deployment for Flash / Flex?

Though I haven't used PureMVC before, can I be bias and say that Cairngorm is much better? :P
flashmech
 
Posts: 45
Joined: Wed Oct 17, 2007 8:24 am
Location: Singapore

Re: Pure MVC

Postby intosite on Tue May 13, 2008 4:05 pm

hi,

am totally new to this, would like to find out more regarding PureMVC...

I'm mainly new to AS3 and don't really have lots of experience in any best practices.

The work i do requires my fla file with lots of movieclips in the library with linkages that i add to stage at runtime. They are done up by the designers with animations and stuff. I've just starting to get the hang of making custom classes for each of these movieclips for their own functionality.

What i'm wondering is where and how does PureMVC fit in. I quite like the idea of the model view controller but not sure where and how it should be implemented.

So does each of the different movieclip class have their own set of mvc codes and then a base one that links up to all this diff MCs and watch for particular event triggers? or it's better that i stick to how i normally do my MC classes and only have one set of mvc code for the base.


A simple scenario would be my main.swf has a preloader animation. it plays while loading diff assets, xml, jpgs, swfs etc.
Once done, it fades out, then shows a welcome mc with an enter button. when click, this welcome mc fades out.
Next the Nav mc is constructed with its diff nav elements animated in.
Then the main content is shown/animated.

cheers
intosite
 
Posts: 5
Joined: Tue May 13, 2008 3:19 am

Re: Pure MVC

Postby intosite on Tue May 13, 2008 5:59 pm

ok, i've tried to do up like a mvc for a movie clip and then created 2 instances of that mc to add on stage.
so far added only a click event handler. seems that clicking either one will trigger response from both and not isolated.
any idea what i can do? i really think that my understanding of mvc and how puremvc work is abit off.

here's my source files,
labs.myplaylab.info/puremvc/MCtest.zip

i'm trying to learn flex 3. am editing all AS files in flex, then opening up the .fla file in Flash cs3 to publish and test.
am trying to simulate the environment of working together with designers who don't touch any codes.
am i doing this right, maybe not right or wrong, but is it productive? or is there a better method to work seamlessly.

cheers
intosite
 
Posts: 5
Joined: Tue May 13, 2008 3:19 am

Re: Pure MVC

Postby intosite on Tue May 13, 2008 6:04 pm

ok, i've tried to do up like a mvc for a movie clip and then created 2 instances of that mc to add on stage.
so far added only a click event handler. seems that clicking either one will trigger response from both and not isolated.
any idea what i can do? i really think that my understanding of mvc and how puremvc work is abit off.

here's my source files,
http://labs.myplaylab.info/puremvc/MCtest.zip
forgot to mention that you'll need the puremvc src files and edit the fla class path to point to puremvc's src.

i'm trying to learn flex 3. am editing all AS files in flex, then opening up the .fla file in Flash cs3 to publish and test.
am trying to simulate the environment of working together with designers who don't touch any codes.
am i doing this right, maybe not right or wrong, but is it productive? or is there a better method to work seamlessly.

cheers
intosite
 
Posts: 5
Joined: Tue May 13, 2008 3:19 am

Re: Pure MVC

Postby leds on Thu Jun 19, 2008 12:55 pm

from our experience, ALON as a communication channel framework enabled us to work with designers without worrying about design changes from time to time. but there is always a risk of mixing up your business logic where it's not supposed to be. Hence we came up with an adaptation of pureMVC instead and used ALON through the facade. It's not very clean and some developers will probably swear off having to use public event listeners, but it gets the job done really fast without worrying about screwing event propagation while allowing our designers to play around and change the design as needed. This is probably true only for a very componetized application - if there even is such a phrase as 'very componetized' ^^.
leds
 
Posts: 5
Joined: Mon Jun 16, 2008 4:48 pm


Return to Design Patterns

Who is online

Users browsing this forum: No registered users and 1 guest

cron