1 Reply Latest reply on Aug 26, 2010 11:44 PM by flex4

    PureMVC architecture question

    Jason_Engr Level 1

      Hello all,


      I have an architecture question regarding PureMVC.  I will try this at the PureMVC forums at some point as well if I don't get an answer. So the question is this.  Assuming you have a Flex/BlazeDS stack and are returning VOs to the proxies through a service.  I need to massage this data for different views.  Say I have a collection of 50 VOs of with a type field.  Is it reasonable to have the proxy api take care of return different views (I mean in the database sense) of the data? So say I have UserServiceProxy.getCollection(type:String) and this returns the list of VOs I need of that particular type.  Or should proxies be very dumb by default and provide the entire collection to manipulate? I am leaning towards Option 1.


      Further if I don't want the base VO set modified, should I clone these before leaving the proxy (this is what I am assuming is correct) or should I clone them in the mediator before passing them to the view?


      Option 1


      If we have 3 views, ViewA, ViewB, ViewC.


      ViewA Mediator needs type A VOs, so UserServiceProxy.getCollection("A"); // 15 cloned VOs of type A

      ViewB Mediator needs type B VOs, so UserServiceProxy.getCollection("B"); // 15 cloned VOs of type B

      ViewB Mediator needs type B VOs, so UserServiceProxy.getCollection("C"); // 20 cloned VOs of type C


      Or should I go with


      Option 2


      ViewA Mediator get the full colleciton, iterate over it and store and clone all A VOs.