In a recent post to his site Marco Bunge offers some suggestions on how to write good application logic in a "clean, testable and reusable" way.
Web based enterprise applications are often accessible via different user interfaces through protocols like HTTP, Sockets, RPC, CLI. The Model-View-Controller is still present as a user-interface pattern. But requests and responses needs to be handled in the way of their interface requirements.
We don’t want to write the same logic for each required interfaces. Furthermore we don’t want to test and maintain code for each required interfaces. We want to write, test and maintain reusable source code at a central point of the application eco-system.
He then talks about the ideas behind the "three-teir architecture" and how this structure can be used to split logic into layers: presentation, logic and data. He mentions domain driven design as a development method to help achieve this structure and his meaning of the word "clean". He then gets into the implementation of this structure, defining the major pieces of functionality for each tier (with code for each included). He ends the post with some suggestions of points for additional reading about things like presenters, the ADR pattern and the "Inversion of Control" principle.