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

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


Tibo Beijen's Blog:
DDD using Doctrine 2 A case study
June 28, 2011 @ 10:54:15

In a new post to his blog Tibo Beijen presents a case study about doing Domain Driven Design in an application using Doctrine2 to work with objects and your database.

Nowadays developing web applications usually requires a flexible process due to changing business logic, shifting priorities or new insights. Besides choosing the right methodology this also requires designing the application in such a way that this flexibility can be achieved. [...] In this article I will show how to implement a specific case using Doctrine 2. Full code accompanying this article can be found on GitHub.

He starts by describing the entities (User/TimeSheet/TimeSheetStatusChange) and how they're defined in Doctrine objects. He modifies them to build in some business-level restrictions like "status changes are only allowed in a certain order". He shows that the domain models presented are about more than just working with the database tables. They enforce rules that effect the flow of the application as well.

0 comments voice your opinion now!
doctrine2 domaindriven design ddd casestudy example


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



Community Events





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


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

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