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

Freek Lijten:
Separating models and logic for storing and loading
February 16, 2015 @ 10:53:43

In a recent post Freek Lijten shares a simplified version of a solution he came up with to separate models and their logic between the fetch and save operations.

Basically I am wondering how storing data and retrieving data are different and how you should / could model this. Since we need different information while storing and retrieving information it makes sense to model those actions in different ways. The how is still bothering me and in this post I give a possible solution. I truly hope I can get some reactions and thoughts of other people in on how they would solve these kind of problems.

He introduces the basic structure of the application he's working with and how the concept of "documents" ties in. Then he gets into the problem: the differences in data required for the save versus locate and load. His solution is to split out the different pieces (relations) of the document into separate value objects. These objects then only contain the handling to get only the relations needed on the load. He doesn't like the solution, however, because of the amount of overhead it introduces.

0 comments voice your opinion now!
separate model load locate save operation object

Link: http://www.freeklijten.nl/home/2015/02/13/Separating-models-and-logic-for-storing-and-loading

Ryan Malesevich's Blog:
Separate Trackbacks from Comments Revisited
February 02, 2007 @ 09:05:00

Ryan Malesevich has posted a new entry that might be of interest you all of you WordPress-ers out there. In it he talks about a plugin you can use to separate out the comments from the trackbacks in the listing for a post.

I was lucky enough to come across a blog post on Binary Moon that included a function that would allow you to break up the trackbacks and the comments in your template. [...] The problem with that is everytime Wordpress upgrades I overwrite functions.php and then comments no longer work.

To get around it, he used WordPress' own plugin system to make the separation via this simple plugin [zip]. It's a simple install, but a bit of functionality that can really help out if you get a lot of both trackbacks and comments.

6 comments voice your opinion now!
wordpress trackback comment separate plugin wordpress trackback comment separate plugin



Community Events

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


api symfony2 performance php7 release series configure community conference podcast example part2 opinion introduction voicesoftheelephpant framework laravel application library interview

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