Complex view hierarchy in pureMVC Actionscript 3

141 Views Asked by At

Consider such situation:

application logic consists of numerous levels, components and relations between them. A level contains groups of components. Two levels or two components can have a special relation between them. All levels, components and relations can have many different parameters.

Here's a quick visualisation: http://i49.tinypic.com/2yv2wsn.jpg

I tried to code it in the pureMVC-way but ended-up having one huge CanvasMediator with CanvasView that manages the complex representation of logic. The problem is that each level and component should be easily copied, deleted, dragged, swapped, repositioned, inserted between to other objects etc. The relations should be created simply draging from one object to another. In other words, there's a lot of interactivity going on inside this CanvasView and I believe the code would be extremely bloated trying to bind each view component to a mediator and executing interactivity code at command level. Yet my approach feels far from right.

A more concrete question: how one would deal with such scenario when a level with lots of components and subcomponents is being repositioned in a pureMVC-way? Keep in mind that while dragging an existing level, it's components should go along too. When hovering in empty space between two other levels, the app should indicate that it's possible to place selected level between the others two (those two should split up a bit and make some room, carrying a long their own componenets in place).

0

There are 0 best solutions below