News Feed

News Archive
feed this:

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

Wojciech Sznapka:
Is Symfony2 a MVC framework?
November 05, 2012 @ 10:18:44

In his latest post Wojciech Sznapka wonders if Symfony2 is actually MVC or if it's just the "C" and "V" in the equation with the "M" (Model) layer being left wide open.

The question is: where is Model layer in Symfony2? My answer is: there's ain't one and it's good.. Symfony2 isn't hardly bounded with Model layer, as it could have been seen in first version. We can see many Active Record model implementations in modern web frameworks such as Ruby on Rails, Django and symfony 1. I'm not saying those solutions are bad. The main problem was, that big systems maintained by plenty of developers changing over time tends to have a messy codebase. The common place to locate business logic were Model layer. The result of that approach were huge model classes, randomly structured Table/Peer classes full of static method and general feeling that system is hardly impossible to maintain anymore.

He talks about the main problem that comes from this style of coding - overly complex systems - and one possible way to help mitigate them using domain-driven design practices. He lists a few of the things that Symfony2 comes with that could be helpful for this method including the dependency injection container, the use of entities, repositories and value objects.

0 comments voice your opinion now!
symfony2 mvc framework domaindrivendesign ddd

Nicolas Bérard-Nault's Blog:
The unknown value of Value Objects
March 31, 2011 @ 12:12:46

Nicolas Bérard-Nault has put together a new post looking at the role that Value Objects play in application development and, more specifically, how they fit in with domain driven design (DDD). He looks to explain the unknown value of Value Objects to developers that might not know how helpful they really can be.

One of the main rules of DDD is that value objects are immutable. This is often not as self-evident as it seems, as many programmers are not even aware of the state they leak and create. Sadly, state is often positively correlated with entropy. Hence, taking steps to contain and to limit state is one of the keys to taming complexity in an application.

He notes that even outside of DDD Value Objects can be quite useful. He gives an example of a "RationalNumber" class with methods for basic things like addition and subtraction. He shows the more traditional mutable version that most developers would start with and uses it in several examples to show its flaws. He finishes up the post with a look at the "more correct" immutable version of the class and a sample call that would result in the correct output of a simple matematical operation.

1 comment voice your opinion now!
valueobject domaindrivendesign mutable immutable

Bradley Holt's Blog:
Immutable Value Objects in PHP
October 01, 2010 @ 11:15:40

Bradley Holt has a new post to his blog about a subject he's recently been learning about, Domain-Driven Design, and how immutable value objects could be useful in PHP.

Yesterday I tweeted: Modern object-oriented programming languages need support for immutable Value Objects. #DDD The "DDD" in that tweet stands for Domain-Driven Design. There were several interesting responses to this tweet.

Responses to his tweet included comments from Matthew Weier O'Phinney, Ralph Schindler, Nicolas Berard-Nault and Giorgio Sironi. He notes that, while all of the suggestions are good, they're only half of the issue. They make it immutable when defined but not during execution. Currently PHP lacks this functionality, but something like this could be worked in with the concept of a "final" class.

0 comments voice your opinion now!
immutable object domaindrivendesign ddd valueobject

Federico Cargnelutti's Blog:
Domain-Driven Design with Zend Framework
March 24, 2009 @ 10:23:20

Federico Cargnelutti has posted the latest article in his "domain-driven design" series using the Zend Framework. This time he focuses on putting some of his ideas into practice.

Some of the Domain-driven design concepts explained in my previous posts are applied in this sample application. I'm also going to use the Zend Framework infrastructure to speed up some development tasks.

His example sets up a domain layer to interface user information for the system from a centralized repository. On top of that he builds his model extended from an abstract class called Zf_Domain_Entity. He also sets up a User collection, a User DAO and the user repository

0 comments voice your opinion now!
domaindrivendesign domaindriven zendframework application

Federico Cargnelutti's Blog:
Domain-Driven Design (Series)
March 17, 2009 @ 10:22:57

Federico Cargnelutti has been posting a series of articles to his blog recently about domain-driven design, a method for organizing your code for maximum reuse between domains. He focuses on the "M" (model) in the MVC structure (model/view/controller) and how it can be separated out into a layer all its own - the domain layer. Here's the parts of his series so far:

0 comments voice your opinion now!
domaindrivendesign domain design series repository data access strategy

Community Events

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

community list release developer configure wordpress threedevsandamaybe series opinion testing podcast code interview refactor framework language laravel unittest install introduction

All content copyright, 2014 :: - Powered by the Solar PHP Framework