The Limits of Software Patterns

There has been a discussion going on Readify Tech (and internal mailing list at Readify) for the last day or so about how business logic is driven/affected by the user interface. One of the interesting points to come out of it is the extent to which software patterns such as MVP/MVC can be used to build truly UI agnostic Presenters or Controllers.

There are a number of software patterns out there that say that they can effectively provide that separation so that logic is reusable, but do they really deliver on that promise?

Personally I think that the reality is that your View, Model and Controller/Presenter are going to be highly optimised for the specific screen that you are delivering on, and in fact it may not be possible to reuse the source anyway. Your ASP.NET Controller isn’t really going to be able to run on your Windows Phone device so why pretend that you can? And even if it did the implementation of the controller is going to make assumptions about the locality of the data that it can access.

Patterns such as MVC and MVP are completely valid, but I wish the proponents wouldn’t make assertions that can’t be backed up.

One thought on “The Limits of Software Patterns

  1. Jonathan Conway

    Perhaps design patterns aren’t intended to make a given piece of code reusable, but rather, to express logic in a certain way so that it can be grasped by developers who have to examine the code in the future. (Which could include the original developer re-visiting his original code.)

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