 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Igor Wiedler: Stateless Services
by Chris Cornutt April 04, 2013 @ 10:41:50
Igor Wiedler has a recent post to his site about creating stateless services, specifically in the context of using a dependency injection container to manage the objects your application uses.
As more frameworks and libraries, particularly in the PHP world, move towards adopting the Dependency Injection pattern they are all faced with the problem of bootstrapping their application and constructing the object graph. In many cases this is solved by a Dependency Injection Container (DIC). Such a container manages the creation of all the things. The things it manages are services. Or are they?
He notes that, according to some of the principles of domain-driven design, "services" should be stateless - the results of calls to the service shouldn't alter it, it should only depend on the values passed in. He goes on to put this into the context of a DIC and gives an example of the "request service" (and how it violates the DDD principles of statelessness). He talks some about scopes (dependencies) and mutable services. He talks about methods to get around these issues with the "request" instance, ultimately coming to the conclusion that event listeners might be the way to go.
voice your opinion now!
stateless services dependency injection event listener request
Gonzalo Ayuso: Managing Windows services with Symfony/Process and PHP
by Chris Cornutt November 01, 2012 @ 10:49:09
In his recent post Gonzalo Ayuso shows how to use Symfony to work with Windows services on the server.
Sometimes I need to stop/start remote Windows services with PHP. It's quite easy to do it with net commnand. This command is a tool for administration of Samba and remote CIFS servers. [...] Today we are going to create a PHP wrapper for [net rpc service].
He uses Behat to create a feature (test) file, the code behind the features and a service class that handles the actual work of interacting with the service (with methods to do things like stop, start and list running services). Examples of its use are also included.
voice your opinion now!
windows services behat feature test class tutorial symfony
PHPMaster.com: An Introduction to Services
by Chris Cornutt April 03, 2012 @ 13:12:16
On PHPMaster.com today there's a new article from Alejandro Gervasio introducing you to the concept of "services", a layer put on top of your models to make a common API that's easier to reuse.
Don't let the definition freak you out, as if you've been using MVC for a while the chances are you've used a service already. Controllers are often called services, as they carry out application logic and additionally are capable of interfacing to several client layers, namely views. Of course in a more demanding environment, plain controllers fail short in handling several clients without the aforementioned duplicating, so that's why the construction of a standalone layer is more suitable in such cases.
He explains the process behind creating a simple domain model (image here) and shows how the Service layer wraps it up into a simpler interface, leaving the model to handle the business logic. He uses the example of an "EncoderInterface" that's implemented in a "JsonEncoder" and "Serializer" to both provide a "setData" method.
voice your opinion now!
services tutorial model wrapper layer
Brian Swan's Blog: Getting Started with SQL Server Reporting Services (SSRS) and PHP
by Chris Cornutt May 06, 2010 @ 10:12:15
Brian Swan has a new post to his MSDN blog today that looks at working with the SQL Server Reporting Services SDK and PHP to automatically create some reports based on the date in your database.
In this post I'll dive into the SSRS SDK for PHP that was recently released by the Interoperability team here at Microsoft. [...] The documentation in the SDK is complete with explanations for the classes that make up the SDK, code examples, and a "hello world" example. However, in this post, I'll build a simple web page (code attached to this post) that renders the Sales report that I created last week.
He starts off with an overview of how all of the technology will fit together and some of the things you'll need to have before you can get started - a user with the right permissions and a connection to the server. The "SSRSReport" class in the SDK gives you quick access to load a report based on a named location. You can then use methods like "RenderAsHTML" to output it as HTML or one of other methods (like CSV, text, PDF, etc).
voice your opinion now!
reporting services sqlserver ssrs sdk tutorial
RIAZone: Integrating PHP with Flash Collaboration Services
by Chris Cornutt December 14, 2009 @ 13:47:28
On the RIA Zone (a part of the DZone network) there's a new tutorial from Ryan Stewart about combining PHP with the Flash Collaboration Services (real-time collaboration and social capabilities via the LCCS) in the second part of his series (part one).
Another great way to integrate LCCS and PHP is with the REST APIs and the library that ships with the LCCS SDK. With those APIs we can perform a number of management functions including creating and deleting rooms, managing roles, and creating templates. These APIs make it very easy to create a customized, dynamic collaboration experience with PHP. You can create rooms on the fly for your users and get information about what kind of content is in those rooms. In this example we're going to create a basic room manager with PHP that will let us create, delete, and view information about specific rooms.
Code is included to use the AFCS PHP library to connect to the Services API and pass in the username and password directly from the user. The request is made and a token is passed back to the calling script. The XML description of the full Flex application is included in the tutorial.
voice your opinion now!
flash collaboration services api tutorial
Aaron Wormus' Blog: Interoperability is Overrated
by Chris Cornutt February 14, 2007 @ 07:19:00
Despite opinions from some of the PHP community, interoperability between PHP applications isn't is such a bad state - at least According to Aaron Wormus:
The fact of the matter is that it's not such a big deal. Porting a plugin from Wordpress to Serendipity is usually trivial, and as we see more web-services based plugins (stuff like the awesome askimet) the task becomes simpler and simpler.
Interoperability is overrated, the more you think of it the more complex it gets. As you start throwing in new factors into the equation (how will this interoperate with a java/c# application) you start to develop monsters like JSR 170 which solve a lot of problems on paper, but in reality are too unwieldy to be truly useful.
He even lists out some of his "steps to interoperability" to help speed things along (like "use as much abstract code as possible" and "use services").
voice your opinion now!
interoperability overrated abstract libraries glue services interoperability overrated abstract libraries glue services
Adam Trachtenberg's Blog: PHP SOAP vs. SDO
by Chris Cornutt October 13, 2006 @ 07:06:47
In his latest blog post, Adam Trachtenberg looks into the world of web services and comes out with three topics - SOAP, axis2, and SDO. He chooses to focus, though, on the last of these after working with it to really get a feel for what it can do.
n my role as eBay Platform Evangelist, I spend a lot of time exploring different XML technologies. SOAP is obviously the big one. No, it's not PEAR::SOAP or NuSOAP; it's axis2.
He talks a bit about what axis2 is and the need it fills in the web services world. He also talks about how it's been developed (not copied after SOAP, but more of a fresh start that happens to do the same things). After this quick look at axis2, though, he gets into the head of the post - SDO.
The other PHP XML extension I've been hearing a lot about is SDO. SDO is an attempt to provide a standard data interface regardless of the backend datasource. So, for example, you can interact with XML data in the exact same manner as information pulled from your database.
Adam decided to give it a try and see how it interacted with the eBay API with some simple code examples. The first of which looks through eBay Motors and finds the title and mileage for each of the items grabbed. It worked well, and didn't require too much more development than the SOAP predecesor, but there were a few quirks that made things a bit more difficult (like SDO's inability to completely consume a WSDL file and understand a SOAP service's functionality).
voice your opinion now!
soap web service sdo axis2 example ebay api motors soap web service sdo axis2 example ebay api motors
|
Community Events
Don't see your event here? Let us know!
|