Against the Repository Command pattern…

So a while back I wrote an article about trying out a new pattern, “the repository and command pattern“.

Since using it in one of our major projects I have found it not all that great. So, yes it’s nice having it split from the Repo which I see as a way of searching on data, however, it’s a pain in the wotsit to test. Also, in Laravel it seems to add a lot of extra un-necessary time to my workflow.

The real problem however appears to be a mis-interpretation of what Commands are used for. Since Laravel 5.1 was released it has re-named Commands to Jobs. Highlighting that they should be used more so for delayed tasks rather than, inserting new models NOW!

So, it’ll take time to un-do I imagine and move them into the repository, however I’m glad I tried it as I’ve learnt a lot about testing!

Author: Dan Course

Dan Course, E-Learning Development at Warwick University (WMG). Agile Scrum trained and full-stack development. Interested in E-learning, Democracy, Politics and Tech. All thoughts are mine and not of my employer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s