News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Paul Jones:
Action-Domain-Responder and the "Domain Payload" Pattern
October 01, 2014 @ 10:16:11

Paul Jones has a new post with more information about his proposed "Action-Domain-Responder" design pattern (a replacement for the typical MVC) and suggests a new piece, the Domain Payload pattern. This pattern would use a domain payload object to wrap the data and provide the responder with additional handling and context.

In Action-Domain-Responder the Action passes input to the Domain layer, which then returns some data for the Action to pass to the Responder. In simple scenarios, it might be enough for the Responder to inspect the data to determine how it should present that data. In more complex scenarios, though, it would make more sense for the Domain to pass back the data in a way that indicates the status of the data. Instead of the Responder inspecting the Domain results, the Domain should tell us what kind of results they are.

He shows a code example of this Domain Payload object in action, starting with some typical MVC code and refactoring it along the way into an ADR structure. He shifts from a typical model into a more domain-driven approach and describes the wrapping of the data in the payload, context for the contents (even just a class name helps) and how those relate to the actual output. You can find the resulting code in this example over on Paul's GitHub account.

0 comments voice your opinion now!
action domain responder mvc adr payload wrapper context data

Link: http://paul-m-jones.com/archives/6043

DevShed:
Sending MIME Email with PHP
July 10, 2008 @ 08:49:20

In this new tutorial on DevShed Alejandro Gervasio explains how to send emails from PHP with MIME payloads attached.

One of the most common tasks that a PHP programmer has to tackle is the development of applications that send MIME email in one form or another. In simple terms, MIME email consists of an extension of traditional email technology and comes in handy for sending email messages in fancy HTML and handling file attachments in a wide variety of formats.

In this first part of the series he just lays the groundwork - creating the mailer class they'll use for the series and using it to send a sample email (a basic message with a plain text MIME block).

0 comments voice your opinion now!
mime email tutorial payload class binary


PHP Web Services Blog:
Payload the Way You Want with PHP5 built-in SOAP
January 30, 2008 @ 15:00:31

The PHP Web Services blog has a helpful hint on getting a custom SOAP request all ready to go:

How do you get this [custom] XML to be output by the SoapClient?

Using the SoapVar method and a few newly created objects, making a custom structure is simple. It's just a matter of encoding the object and setting it with the base() method in the PHP SOAP extension. Check out the blog post for an example of both the custom XML and the code to produce it.

0 comments voice your opinion now!
payload custom soap extension soapvar object encode



Community Events





Don't see your event here?
Let us know!


package composer version language symfony series release application opinion install podcast tool library framework community security laravel introduction voicesoftheelephpant interview

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework