[Tutor] Best Code testing practice?

Alan Gauld alan.gauld at btinternet.com
Sat Jun 22 00:34:05 CEST 2013


On 21/06/13 19:07, Prasad, Ramit wrote:

> Have you heard of the MVC model? The idea is that you separate the
> business logic from the "view" or UI. The "controller" contains
> all the business logic (or work actually being done).

Being slightly picky but the business logic should sit mainly
in the Models. (ie the rules around how the data is manipulated,
the algorithms etc)

It's the scenario flow (or worklflow) that should sit in the
controller. ie The controller sequences the scenario or
use case by orchestrating the actions of the Models which in turn 
reflect their state changes in their associated views (GUI screens/panels).

In the original (Smalltalk) MVC pattern the Controller manages
user input but in later variants this is often a function of
the Views which then delegate to the associated controller.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list