"Also consider that this technique could help encourage a MVC paradigm within Quartz Composer."

It's apt that you mention that^ because MVC is exactly the reason I made this JS patch suggestion. Currently I'm trying to model a prototype a MVC set-up in a QC comp or even perhaps 2 or 3 comps (one for each part). (Happy to share it when I get somewhere I'm modelling that Simon musical button game for a case study). In QC it's a special challenge to do this as it's a functional environment with no resources specifically devoted to MVC like Cocoa has.

Say one has 3 JavaScript patches for each of Model, Controller and Viewer, does one pass messages between the JS patches with codified constants (eg: var k_play_an_A_ON = new Number(); k_play_an_A_ON =1; result.Message_to_Viewer = k_play_A_ON; ) to get parsed whenever the other Module is ready to do so. Or could one have live 'State' booleans that determine if, say, the Viewer module should be accepting Inputs and live Structures that are immediately interpreted to, say, display particular Output states.

I've been reading a fantastic book of interviews with well known programmers (Coders at Work) and one take-away I got was not to over generalise my code, only bite off what I need to do — don't over- engineer for expansion/more function than required; leave that for later. I'd like to have a go at MCV inside QC because I have made an Application in QC that drives other .qtz compositions. I'll probably use Quartz Builder to distribute the App, at this stage.

My Javascript patch for parsing the 28+ on screen button inputs is becoming a bit unwieldy in terms of adding functionality without breaking existing functionality — it's Viewer and Controller all in one, and then I have another JS patch (hooked to tons of structure patch noodling) for the Model which is not talking to any other JS patches yet just responding to manual inputs.

The idea of separating into MVC seemed like a good organising principle as much as a code beautifying / rationalising one. Communication between the MVC parts / modules is what I am probing / flailing around with at present. Any advice welcome.

Best to all
Alastair
Useful Design




On 08/12/2010, at 9:51 PM, Adrian Ward wrote:


Hear hear.

rdar://8743194
http://openradar.appspot.com/radar?id=953401



On 8 Dec 2010, at 06:14, Alastair Leith wrote:

Would it be possible to implement composition/application wide globals for the Javascript patches in a future QC revision?

I know graph evaluation and free global variables could create a headache if used unwisely, but it would be kind of neat at times to have a composition-wide layer to read/write get/set to. Couldn't it just operate on an ad-hoc basis read to whenever (whatever JS patch is being evaluated) write whenever (same).

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/qc.student.au%40gmail.com

This email sent to qc.student...@gmail.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to