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

Mathias Verraes:
Objects as Contracts for Behaviour
September 29, 2014 @ 11:10:33

Mathias Verraes has a new post to his site today with an interesting idea when it comes to handling the architecture of an application: using objects as the contracts for behavior. He suggests that the objects themselves define how other pieces of code should interact with them, not necessarily external services. He illustrates with an invoice and appointment example.

Of course invoices do not pay themselves, but that's not what an object model is trying to do. An invoice exposes the behaviour of being able to be paid. That ability is in fact essential to what it means to be an invoice. The behaviour is an inherent property of an invoice. If an invoice doesn't have the ability of being paid, there's no point in issuing invoices at all. In other words, the contract of an invoice object declares that its interface includes payment as a feature. Its promise to the outside world is that it allows an outsider to pay for it. Encapsulation of state and behaviour is the core idea behind objects.

He wonders why, if this is more true to the "object-oriented programming" ideals, the idea of encapsulating procedural code as objects is so widespread. He suggests a lack of education on the subject or maybe even confusion from spoken languages themselves.

0 comments voice your opinion now!
objectoriented programming oop contract expose behavior property

Link: http://verraes.net/2014/09/objects-as-contracts-for-behaviour/

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

Larry Garfield:
On empty return values
March 29, 2013 @ 09:15:59

Larry Garfield has posted some of his thoughts on return values and reminds you about consistent return types, regardless of the result.

Earlier today, I posted a brief tweet (isn't that redundant?) about return values in PHP (or really, any language). Originally it was about return values from functions (such an exciting topic, I know), but it ended up generating a fair bit of lively conversation, as well as a patch against Drupal 8. So lively, in fact, that I think it deserves more than 140 characters.

He proposes a new rule of thumb: "If your function returns a collection, its null value return must also be a collection." A more broad version of this might be: "make your return types consistent." It's all about predictability and the contracts you have between different parts of your code. If a user calls your method expecting to be able to loop over the results, they'll be disappointed with a "false". He talks some about using and throwing exceptions more effectively for error handling and answers several "but wait..." arguments for his return strategy.

0 comments voice your opinion now!
empty return values opinion contract exception expected


James Fuller's Blog:
Enforcing contracts in your PHP functions and methods
March 23, 2012 @ 08:37:11

James Fuller has a new post to his blog today about a way you can enforce contracts in your PHP using a combination of type hinting and value checking.

Design by contract is an important concept for controlling what type of input your methods or functions can receive. One of the most dangerous features of PHP is that functions will still execute even when they are missing required arguments, by emitting a warning instead of an error. In this post, I am going to walk through some of the solutions available to deal with this problem.

He shows how to alter a basic function to first use type hinting to catch when a variable is the wrong type (in this case checking for an array and stdClass) which causes a Fatal error and makes the function not execute. He includes sample code for the type/value checking option and also includes a suggestion of using PHPUnit's assertions as another option.

Finally, he introduces the ContractLib tool (from Stuart Herbert) that makes use of closures to enforce checks - his example checks to see if something is a string and that it's not empty.

0 comments voice your opinion now!
enforce contract function exception typehint contractlib


Stuart Herbert's Blog:
ContractLib - An Introduction & Comparing it to PHP's Assert
January 17, 2012 @ 10:58:38

Stuart Herbert has two new posts to his blog showing how to use the ContractLib tool he's created to define programming "contracts". In the first he shows some sample usage of the tool and in the second he compares the functionality of ContractLib's features and PHP's own "assert" method.

ContractLib is a simple-to-use PHP component for easily enforcing programming contracts throughout your PHP components. These programming contracts can go a long way to helping you, and the users of your components, develop more robust code.

In his example tests he shows how to set a pre-condition on a method's input ensuring that it will always be the correct datatype (array). In his comparison with PHP's "assert", he lists out some of the features that either one has and notes that ContractLib allows you to be much more flexible with your checking than just simple statements.

0 comments voice your opinion now!
contractlib contract programming validate assert compare


Stuart Herbert's Blog:
Introducing ContractLib (Programming Contracts)
January 13, 2012 @ 14:11:52

In this recent post to his blog Stuart Herbert introduces a system he's created to handle "contracts" in PHP development - ContractLib.

Programming contracts are tests around functions and methods, and they are normally used: to catch any 'bad' data that has been passed into the function or method from the caller, and to catch any 'bad' data generated by the function or method before it can be returned to the caller. These are pre-condition and post-condition tests, and they are tests that either pass or fail.

He points out that by having contracts you not only increase the robustness of your code but you also save time not trying to hunt down data-related issues. Using pre-conditions, you can can check data to ensure things like correct formatting, data that's out of range and data that might be missing. His ContractLib comes with a set of tests that provide good examples of how to use the functionality. Installation instructions are included.

0 comments voice your opinion now!
programming contract contractlib test data bad


Cal Evans' Blog:
Six ways to be a better client for your developer - Point 6
January 26, 2011 @ 12:51:31

Cal Evans has posted the final point in his "Six Ways to be a Better Client for your Developer" series seeking to make the client/developer relationship more stable and enjoyable for both sides. This latest tip involves the paperwork part of the relationship.

Good fences make good neighbors just as good contracts make for good developer/client relations. At the very least your agreement with your developer should contain a complete description - in non-vague terms - of each feature to be built as well as a paragraph description of the overall project.

He emphasizes that, if the feature or change is not included in the documentation from the start, it's not a part of the project. Making assumptions on vague definitions will only cause problems down the road, so be specific in what you want.

If negotiating the contract with your developer is a hassle, consider it your last opportunity to walk away and find another developer.
1 comment voice your opinion now!
client developer opinion paperwork contract specific


Cal Evans' Blog:
Six ways to be a better client for your developer - Point 6
January 24, 2011 @ 10:08:33

Cal Evans has posted point number five of his six ways that a client can do their best to work with the developer(s) on their project (and get the most out of the relationship). This next point deals a subject considered by some to be a bit uncomfortable - money.

Let your developer know up front how much you have to spend, don't make them guess. They know what they can build projects for and letting them know up front helps them decide what tools to use and even whether they can afford to take the project or not.

He recommends the client ask for references and check them before committing to the developer and how close they came in the past to the goal budget. They should understand that, once the initial price and design is agreed upon, changes should be handled separately - no one-off requests squeezed in at the last minute. Hitting a moving target is asking for trouble.

0 comments voice your opinion now!
client developer opinion budget contract feature


Job Posting:
Moontoast Seeks PHP/Symfony Engineer, Contract (Nashville, TN)
January 04, 2011 @ 22:13:51

Company Moontoast
Location Nashville, TN
Title PHP/Symfony Engineer, Contract
Summary

Who You Are
You have over 3 years of professional work experience developing web applications and you think social is going to change the online world. You are analytical, inquisitive, energetic with a bias toward action, and comfortable with both quantitative and qualitative data. You understand and embrace agile development, and you want to write the best code of your life every time you sit in front of the computer, but still understand the difference between theoretical perfection and working software you can actually deliver.

What You'll Do
As a contract PHP/Symfony guru for Moontoast, you will be supporting the continued development and maintenance of our flagship Commerce Community product. You will be called upon to perform the following Herculean tasks to that end:

  • Work closely with the Product Manager to determine both what features are feasible and what resources in terms of time, money, and manpower said features will take to get done.
  • Design new features, maintain existing functionality, and execute a whoop-ass product using a boatload of different technologies. Be excited to try new techniques and tech but also recognize the value of the tried-and-true.
  • Respond to bug reports with speed, and test your fixes. For that matter, test everything else too.
  • Communicate your designs to the other team members in a way that everyone understands and will minimize back-and-forth.
  • Collaborate with and rely on the experience and knowledge of the Software Architects, but don't follow blindly. If you disagree, say so. Discussion never hurt anyone.
  • Respect the best practices and standards of both the industry and the company.
  • Write robust automated tests.
  • Own your work - when you screw up, admit it, fix it, and learn from the experience.
  • Playing the blame game is a waste of time, and nobody likes a complainer.

Desired Skills and Experience

  • >3 years of experience in Web 2.0 app development (Web Services, PHP, Ajax)
  • PHP and OOP expertise. Know your OOP axioms.
  • In-depth knowledge of and experience with Symfony 1.3/1.4 and Doctrine 1.
  • Extensive experience working with RDBMSs (primarily MySQL).
  • Comfort working in a Linux environment, and deep familiarity with a CLI text editor like VIM or EMACS.
  • Strong knowledge of HTTP.
  • Experience working with the git VCS.
  • Working knowledge of client-side technologies like HTML, CSS, & JavaScript.

About Moontoast
Moontoast is a complete social commerce platform that makes social media profitable. Working seamlessly within a brand's social experience, Moontoast products create deeper connections and conversations through highly interactive communities; streaming, pay-per-view events; and exclusive, private sales clubs. Each product in the Moontoast suite dovetails into the next, creating a virtual funnel designed to increase engagement and spend at each level. Moontoast currently offers three core products for either standalone or integrated implementation- a branded community, embedded store, and private sales club. An extension to the store product, includes features tailored to meet the social commerce needs of the music, retail, and publishing industries, is scheduled to launch in early 2011.

Please send your resume to jobs@moontoast.com.

0 comments voice your opinion now!
moontoast job nashville tn symfony contract engineer


Job Posting:
Moontoast Seeks Senior PHP Developer (Nashville, TN)
April 27, 2010 @ 18:26:08

Company Moontoast
Location Nashville, TN
Title Senior PHP Developer (Contract w/Full Time Possibility)
Summary

Summary:
Moontoast is a social commerce network for people to pursue and promote their passions through personal relationships. Moontoast simply connects those who know, with those who want to know.

Moontoast is seeking passionate, senior PHP developers-who want to pursue and promote their passion for writing high quality code-to enhance the Moontoast social commerce platform. We are looking for self-motivated individuals with the right attitude and excellent skills who can hit the ground running in a fast-paced web startup. Ideal candidates will thrive in a tight-knit team environment, promoting their passion for software design by leading product teams and mentoring our growing development team.

The main responsibilities of a senior PHP developer include:

  • Working with the senior developers and architects to provide leadership in technical design and architecture of the Moontoast platform
  • Setting estimates and expectations for new product development and implementing new features, tracking on target deadlines
  • Mentoring and leading developers by example through writing clean, well-documented, maintainable code and enforcing standards and best practices
  • Participating as an active Moontoast Guide in the Moontoast Developer Community

Requirements
We are looking for:

  • 5+ years of experience with PHP
  • 8+ years of experience with web development
  • Deep understanding of browsers and HTTP
  • Experts at object-oriented programming concepts and design patterns
  • Demonstrated ability to design and develop complex web services
  • Extensive experience with the Symfony framework and Doctrine
  • Working knowledge of version control systems (Subversion, Git, etc.)
  • BS in Computer Science/Engineering or equivalent experience

We would like to see:

  • A passion for web development and an interest in sharing that with others
  • Independent thinkers with strong leadership qualities
  • Demonstrated ability to develop large-scale websites
  • Experience with service-oriented architectures, web services, and Cloud technologies
  • Knowledge of advanced data organization concepts, such as sharding
  • Experience with other PHP frameworks utilizing the MVC design pattern
  • Expert Linux development skills, from the command prompt to the web server
  • Open source project development experience
  • Developer community involvement (blogging, speaking, articles, Twitter, etc.)
  • Zend PHP 5 Certification
  • MS in Computer Science

We invite interested candidates to send resumes to hr@moontoast.com.

0 comments voice your opinion now!
senior developer nashville tn moontoast job contract



Community Events





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


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

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