News Feed
Jobs Feed
Sections




News Archive
feed this:

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

Anthony Ferrara:
Beyond Inheritance
November 05, 2013 @ 13:08:24

In a previous post Anthony Ferrara looked at design patterns and their use (and usefulness) in modern applications. in this new post he continues the series but focuses more on a strategy to move past them related to inheritance.

In my last post, I talked about revisiting the concept of Design Patterns and questioned how useful it is to "learn" them. The conclusion that I came to was that you are better served by focusing on how objects communicate rather than traditional patterns. Well, that's not the only "traditional concept" that I think we should move beyond. So, let's talk about inheritance...

He starts with a bit of definition about what inheritance actually is (for a little context) related to classes, not traits or interfaces. He compares two ideas around this inheritance - the actual implementation of it in the code and the specification of it, the planning a "promise" the structure defines. He discusses the separation of these two ideas and that what matters is that the specification is implemented - how doesn't matter as much. He gets down to the most basic concept behind the idea of inheritance, the idea of a "contract", that defines the "agreement" the implementation puts into practice.

Finally, he gets down to what he calls "the key" behind inheritance and encapsulation of functionality into desecrate parts - behaviors. These allow you to know what kind of functionality comes from which class/object without having to guess. Methods have behaviors and objects are collections of these, combining to make a larger object-centric behavior.

Object Oriented Programming is all about abstraction. Each layer is an abstraction of code below it. Using "types" makes this difficult, because often we don't have real-world analogs to represent each layer. After all, an abstraction is specifically not a type. It's the concept behind it. With behaviors, this comes naturally.
0 comments voice your opinion now!
inheritance specification implementation contract behavior oop

Link: http://blog.ircmaxell.com/2013/11/beyond-inheritance.html

Chris Hartjes:
PHPSpec and the New Wave of Testing
October 19, 2012 @ 08:42:18

Chris Hartjes, a big proponent of testing in web applications (mostly in the PHP realm so far) has a new post to his site with some of his thoughts about PHPSpec, the specification-driven testing tool recently released by the same folks who made Behat.

I think that we are witnessing the first wave of new testing tools in the PHP community that allow developers to wrap their applications in automated tests. I am familiar with the BDD-style that is being promoted in PHPSpec, through my work with Behat to create automated user acceptance tests. I think if you want a tl;dr version of PHPSpec I would tell you "write hybrid unit/integration tests using plain language".

He notes that writing code to match a specification has similar concepts to using unit testing for TDD (with something like PHPUnit). He points out a few interesting things like the use of mock objects and the fact that you'll still need to write some code to make tests work - that's unavoidable right now.

0 comments voice your opinion now!
phpspec testing functional unit specification tdd


Konstantin Kudryashov:
phpspec2 SUS and collaborators
October 09, 2012 @ 08:32:55

Following the release of the phpspec SpecBDD tool, Konstantin Kudryashov has posted this new article talking about SUSes ("Subject Under Specification") and how they relate to the functionality phpspec offers.

First of all, phpspec2 is not a testing framework. It's a SpecBDD tool. It means, testing is not our primary aim. Tool's job is to enforce and make SpecBDD in project flawless and phpspec2 uses all available methods to do that - state of the artformatters, class and method generators and lot of othe fancy buzzwords :) Today, i want to explain you the heart of phpspec2 - SUS, collaborators and prophets.

He starts off defining specifications as a list of behaviors about how an object should behave and the abilities that come with them (like "getTitle"). He shows assertions, like "shouldReturn", and how you can use Collaborators to evaluate the interfaces between objects.

0 comments voice your opinion now!
phpspc specbdd specification object collaborator sus subject


Keith Casey's Blog:
Where Open Source Fails
September 30, 2010 @ 12:12:01

In a new post to his blog today Keith Casey has voiced some of his opinions on where he thinks most Open Source software efforts fail in their goals of making good, quality software that's well-developed and useful.

Earlier this week, I unsubscribed from the mailing lists of a pair of Open Source projects. About two years ago when I found the projects, they involved fascinating topics in under served niches. One of those niches - the one customer/user-facing - is still there and under served, but that's not relevant in the current discussion. In reviewing the activity on the mailing list, I noticed some interesting things: activity was very high, there were some smart people involved in the discussions and there was a lot of discussion on what should be done but nothing actually getting done.

He notes that without a codebase to work from, there can't be any direction because no one knows where things are headed or what can be done to improve it. Writing up a spec to guide the development can help, but then you still have the pitfall of who should write that spec.

0 comments voice your opinion now!
opensource software fail opinion specification


php|architect Blog:
Goodies for PHPers in Internet Explorer 9
April 13, 2010 @ 10:08:07

On the php|architect blog today Orlando Medina points out a few goodies in Internet Explorer 9 that could be useful for PHP developers out there.

Microsoft has some catching up to do in terms of standards compatibility, but they are also doing some good things with this browser. They are bringing some much needed web-standards compatibility, in addition to some JavaScript performance enhancements.

Handy new features include better HTML5 support, CSS3 support, XHTML parsing, Javascript compilation and an overall trend towards a more standards-based approach that Microsoft hasn't worried about in a good while now. He also mentions the OData toolkit that lets your web applications speak the same "language" according to Microsoft's more unified specification.

0 comments voice your opinion now!
internetexplorer web standards odata specification


Brandon Savage's Blog:
The 15 Minute Rule Of Software Development
March 19, 2010 @ 10:54:06

Brandon Savage shares some of his thoughts on software development and how creating the spec for the project affects it by basic it on a rule - the 15 Minute Rule.

Since most developers (myself included) are also generally bad at developing good specs, it becomes even more difficult to create such a rule. However, I heard a great adage from someone recently that I thought summed up how developers can see specs nearly perfectly. "If it takes more than 15 minutes to determine what it is that you're building, the spec wasn't done properly".

He suggests that not a single line of code should be developed before the spec is completed and, since developers usually aren't the ones creating the spec, they need to have a clear, concise definition of what's expected before hand.

0 comments voice your opinion now!
opinion specification software development


Brandon Savage's Blog:
Painless Spec and Schedule Development
December 16, 2009 @ 11:42:59

Brandon Savage has written up some thoughts on what can be a somewhat painful part of software development - creating the specification and schedule for the development of the application.

In the time that I have developed software, I don't know that I've ever met a developer who got excited about writing specs for anything. In fact, most developers loathe writing specs, or developing schedules of any kind. [...] Businesses need schedules to know when products will be finished and schedule things like trade shows, product launches, and write contracts with clients who need or want a particular product.

He has a few recommendations for things that could make the process a little easier including the fact that specs should not be considered documentation, that the developers should be the ones creating them and that scheduling out the development time line isn't all about the actual development.

0 comments voice your opinion now!
specification timeline development software


Ian Selby's Blog:
Create a REST API with PHP
February 20, 2009 @ 10:26:29

In this recent post to his blog Ian Selby looks at how you can create a REST API that can be used as an interface layer on top of any PHP application.

One of the latest (sort of) crazes sweeping the net is APIs, more specifically those that leverage REST. It's really no surprise either, as consuming REST APIs is so incredibly easy… in any language. It's also incredibly easy to create them as you essentially use nothing more than an HTTP spec that has existed for ages.

He looks at what REST is - both the request and response sides - and some of the PHP code you can use to create your own service. His example defines all of the HTTP codes and uses a processRequest function to handle the incoming request. The response is pushed back out from the processResponse method and even includes an extension of the class to handle XML requests if they're POSTed.

0 comments voice your opinion now!
rest api tutorial xml introduction http specification


Mutant PHP Blog:
Specifications for PHP5
September 30, 2008 @ 11:17:47

In a recent entry to his blog Sean shows off a new specifications library he's created to replace common comparison functionality with a series of specs.

I thought I'd share a PHP library implementing this idea by Evans and Fowler. Written for PHP5, it's a library for defining custom specifications using composition and inheritance.

He gives the example of "Person" objects with name and age properties. A search might involve looking directly at the properties to location one that's, say, younger than 35 and has a last name of Johnson. His specification class replaces this and makes it more reusable by applying things like GreaterOrEqualSpecifications and EqualSpecifications to standardize the evaluation. Then its just a quick call to the isSatisfiedBy method to check for correctness.

0 comments voice your opinion now!
specification php5 class download evaluate reuse


Zend Developer Zone:
Microsoft to extend Windows eco-system!
February 22, 2008 @ 13:58:00

On the Zend Developer Zone today, Andi Gutmans has written up a new post that, in light of a recent announcement from Microsoft about "going open source" with some of their products, asks what it means for the web and for the PHP community specifically.

Today Microsoft announced a significant initiative which aims to provide the developer community with access to a large number of Microsoft protocols and file formats. [...] With Microsoft opening up their specifications under the OSP, open-source communities like Zend Framework are now able to build such solutions without fear of litigation. There are many other areas where it will benefit open-source projects including Samba (SMB), FreeTDS (SQL Server), Mono (.NET), and others...

He shares his thoughts on the winners (Microsoft themselves, Open Source community) and losers (Microsoft's competitors, Linux) on the deal and the beneficial impact he thinks it will all have on the PHP.

1 comment voice your opinion now!
windows opensource community specification promise



Community Events











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


framework component hhvm symfony2 podcast introduction facebook language hack composer overview package unittest application security code threedevsandamaybe opinion release install

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