Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  PureMVC Manifold / Multicore Version / Re: Native Javascript port? on: January 10, 2012, 11:28:20
I too am interested in a native port and was about to dig into the source in the svn link you provided in another post (http://svn.puremvc.org/PureMVC_JS/branches/native-multicore/).  Mainly documentation left?  FWIW, I would be happy to help however I can in that area while I am digging.
2  PureMVC Manifold / Standard Version / Re: How to output amf as a viewcomponent? on: December 16, 2011, 07:28:44
After a lot more reading last night I realize this wasn't really a feasible question.  AMF isn't just a format, it's also how the messages are sent and received.  Technically, I could implement the serialization in the viewcomponent, but I would also have to address the RPC portion as well (like SOAP or REST).
3  PureMVC Manifold / Standard Version / How to output amf as a viewcomponent? on: December 15, 2011, 02:32:40
I'm writing a basic API to some backend settings and I would like to return the results in different formats (xml, html, etc) for different frontends to consume.  How would I go about outputting amf?

I can think of three different routes (and none seem like they would be feasible)..

Wrap the facade within the services class...and somehow return data from the viewcomponents?

Create the gateway/services and pass that into the API to be used as a viewcomponent...and somehow still be able to access it properly as a remote object?

Something like this: http://efreedom.com/Question/1-1942890/Self-Contained-Library-Serializing-PHP-Data-AMF where I basically have to format the amf output myself.


Any ideas greatly appreciated!
4  PureMVC Manifold / Standard Version / Re: writing to xml config files in a proxy on: September 08, 2011, 10:36:23
I'm confused. You are setting XML, type regular string, as Proxy data? Why not set DOMDocument instance or SimpleXMLElement instance as Proxy data?

No, I am wanting to use the DOMDocument or SimpleXMLElement instance as the proxy data.  My question was more related to how to implement either of them.  For example, if I have this...

:
<?php
class FooBarProxy extends Proxy implements IProxy
{
    public function 
loadXML($filename)
    {
        
$xml simplexml_load_file($filename);
        
$this->setData($xml);
    }

    public function 
getNodeValue($nodeName)
    {
        return 
$this->getData()->$nodeName;
    }
    
    public function 
setNodeValue($nodeName$value)
    {
        
$xml $this->getData();
        
$xml->$nodeName $value;

        
$this->setData($xml);
    }
}
Whenever I call setNodeValue, I am basically creating a second copy of the xml data in order to update with the new value.  In AS3, getData returns a reference to the actual data so in terms of PHP it would something like this...

:
public function setNodeValue($nodeName, $value)
    {
        $this->getData()->$nodeName = $value;
    }


My overall question is..would my original setNodeValue function from the first code snippet be considered "correct"?  Ie.  make a local copy of the xml instance, manipulate it, then setData. 
To me, making that second local copy just seems inefficient.  I would think it would be better to use the proxy to somehow manipulate the data directly...not make copies, manipulate, then setData.
5  PureMVC Manifold / Standard Version / writing to xml config files in a proxy on: August 29, 2011, 11:22:47
I have several proxies that interact with their own corresponding xml file.  The xml is then used as the proxy data to manipulate.  I am stumped as to how to change the xml data....or better yet, I am stumped because "getData()" does not return a reference (like AS3 does).  It seems in my setter functions, I would have to pull the entire contents of the xml in to a variable, do the necessary changes, then "setData()" with the updated xml data.  OR, I override the getData() to return a reference.  OR, I use a delegate to do the xml manipulation and use the delegate as the proxy data.  No matter which way I try to implement it, I get the feeling I'm doing it wrong.  Any advice or suggestions?

Thanks
6  PureMVC Manifold / Standard Version / Closing tags in PureMVC files? on: July 26, 2011, 08:49:28
I noticed that the puremvc php files contain the closing tags.  Personally I leave them out of files that are pure php to avoid possible 'headers already sent' errors.  What are the maintainers thoughts on this?
Pages: [1]