1 Reply Latest reply on Jul 13, 2009 2:22 PM by ProjectedSurplus

    ValueObjects and Flex 3 or 4 Wizards

    ProjectedSurplus Level 1

      I think I have many of the VO concepts down but still am not quite getting it to work so if I could get some quick feedback it would be much appreciated.

       

      So I have a RemoteObject which calls a cfc that then calls a MySql Stored Procedure and ultimately returns to flex a (I guess) structure/object/query/Array/ArrayCollection??? in the sense that I don't have any data typing in the cfc (ie I can display the returned results in a Datagrid where the headers are the database field names).

       

      Now, various tutorials SEEM to suggest datatyping the results in the cfc and then via the alias attribute I think mapping said cfc to a similarly defined flex vo (which the Flex 3 cfc wizard purports to do automatically).  I again think this step also includes essentially stripping off the database fieldnames and thereby benefiting from reduced data transmission and flex receipt computation requirements -- but to me it seems an imposition of logic on the CF "layer" (whereas I've thought that the app would be best with logic at mainly the dbase but secondly at the flex client layer).  Am I correct in this/these deduction(s) -- fwiw I have yet to find a tutorial which spells such a process out without assuming a better knowledge of CF than I have -- and what are opinions on the performance implications???

       

      Secondly (and regardless of whether cfc typing occurs) I think I have been missing the step in the vo process in which the vo is stored in a "model" layer. Cairngorm/Mate/etc aside, if say in my main app I import the CustomVO.as then the next steps are to "populate an instance" of the vo -- but then to further save said instance in a "model" (the step I've been missing) -- and then bind my app components to the model (ie NOT to the instance), right?

       

      Obviously such a process is not necessary in every application but fwiw my app detects visitor location (based on ip) and then returns a look&feel specific for say each state.  Moreover, members who then log in are shown the look&feel they may have previously customized.  Now, the backend dbase to do this works fine but on the flex/client side I'm thinking (derived from tutorials) to:


      A.) Include in the main app a <mx:Model> with default look&feel values (not much data and good insurance for if say dbase goes down)

       

      B.) have a initialize=". . . "  call a <mx:RemoteObject> which returns the state specific values which then overwrite the values in the model above

       

      C.) Upon successful signin return member specific values  (I THINK that before overwriting the model here I want to write the (B) values to a SharedObject such that upon signout there is not the need for another call to the server.

       

       

      Anyway, thanks for reading this novel, let me know if I am on the right track (or continuing the trainwreck )

       

      -------------------------------------------------------------------------------------

      Edit:  Not to further impose but relatedly what are best practices for say search results (ie paginated lists) -- should/need they be valueObjects (seems like a great deal of computing to me) and/or typed on the CF server side?