1 Reply Latest reply on May 28, 2009 12:51 PM by ProjectedSurplus

    ValueObjects

    ProjectedSurplus

      I've come via a MySql to CF to Flex learning path thus

       

      1.) my flex app uses <mx:RemoteObject> with source= pointing at a CFC (in wwwroot/test/cfcs directory).

       

      2.) Said cfc calls a MySql STORED PROCEDURE which returns (say) a list of "owners" (id, firstname, lastname, etc).

       

      3.) CF passes this back to Flex (apparently in the form of an Object?).

       

      4.) I can get Flex to then bind this returned data to a <mx:DataGrid>.

       

      However, I've read extensively on VOs (as well as Cairngorm/MVC) yet don't fully understand either the "why" or the "how".  Moreover, because my CFC's use StoredProcs Flex's CF wizards don't seem as useful (not that I know how to work the wizards in any case).

       

      Assuming as basic an example as possible, upon receiving the returned data I use AS3 to first define then instantiate an ownerVO, then a function to populate the ownerVO with the results of the RemoteObject then I populate the DataGrid with ownerVOs????  I've also seen references to CF declaring properties and thereby "mapping" (via aliases) the CF data to AS???

       

      Nonetheless I remain fairly lost (most tutorials seem targetted beyond my understanding level) so comments and/or directions to appropriate learning resources would be appreciated.

        • 1. Re: ValueObjects
          ProjectedSurplus Level 1

          Ironically upon reluctantly plunging back online today in a quest for VO understanding I came across this post:  http://www.advantexllc.com/blog/post.cfm/how-oo-almost-destroyed-my-business

           

          Now let me first SHOUT a sincere thankyou to all community members who contribute their expertise to these forums.  Second I want to stress my frustration is similar to the above poster in the "requirement" to "learn" so extensively at the expense of "getting things done".

           

          That said, even my limited experience in HTML revealed the need of big apps such as the one I am attempting to have an "architecture".

           

          So, rather than continuing to understand VOs as a building block toward implementing an architecture I've decided to tepidly take on one of Cairngorm/MVC/Swiz -- actually Mate is the "leader" after the first hour of reading fwiw.

           

          Yet (in no small part because the decision above could be a blind alley) I would appreciate continued feedback on a few "conclusions" I set out below (hopefully) for the benefit of future readers.

           

          1.)  MVC needs to be understood in the context that all three building blocks of a web app (Database -- WebServer/CF -- Frontend/Flex) might each contain some of all three "MVC aspects" (ie model exists both on View and obviously at dbase).  Hence for example a CF architecture like cfonwheels is potentially both  supplementary to and redundant to a flex architecture. Similar assertions apply to my intention to push (some) business logic past from CF into MySql Stored Procedures.  For better or worse though, many existing architectures focus solely on their "layer" (DB/WebServer/View).

           

          2.)  Implementing any architecture infers learning and then working with a great deal of other peoples sometimes poorly documented code.  Yet this to an extent is not that different from using say MXML -- which I probably am semantically wrong to say but is arguably an "architecture" itself.  Regardless, architectures add overhead to non-large apps (presumably there is an economy of scale effect).

           

          3.)  Boiling everything down, the need is to manage DBase <--> View interactions.  JSP/CF can assign properties to DB elements which Flex/AS can "map" to for increased efficiencies.  Cost/Benefit of CF included, are JSP a more "programmically straightforward" option??

           

          As always, thanks in advance.